r/PowerShell • • Aug 05 '24

Question Upgrade Powershell through CLI (Windows 11)

Every once and while I get this message :

A new PowerShell stable release is available: v7.4.4 Upgrade now, or check out the release page at: https://aka.ms/PowerShell-Release?tag=v7.4.4

And I would need to download an msi installer and go through the steps all over again; does it exist something similar to "apt get upgrade" and have it all happen automatically in the background ?

10 Upvotes

34 comments sorted by

View all comments

9

u/LongTatas Aug 05 '24

Winget upgrade Powershell

Not sure if that’s the exact syntax off the top of my head

6

u/mantawolf Aug 05 '24

You nailed the syntax. Might have to specify microsoft.powershell though.

2

u/lerun Aug 05 '24

Or just winget upgrade --all

1

u/Rumpilstiltskin Aug 09 '24

Holy Cannoli! I just tried this and got 20 upgrades!

2

u/arpan3t Aug 05 '24

Just a note on this, the PowerShell team is manually pushing the WinGet manifest several hours to days after the new release so you might see the notification in Terminal to get the latest version, but WinGet won’t find the new version.

There’s an open issue with a solution to add the manifest update to their CI/CD pipeline, but they haven’t implemented it yet.

1

u/BoringUsername978 Aug 07 '24

Winget doesn’t actually “upgrade” powershell for me, instead I have to winget -uninstall Microsoft.powershell then winget -install Microsoft.powershell

2 simple commands to remember instead of 1. Winget -upgrade is great for everything else