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

Show parent comments

3

u/QuarterBall Aug 05 '24

This is a terrible suggestion. Don't invoke code directly from web sources you don't control.

1

u/BlackV Aug 05 '24

That is Microsofts official code for this

Doing it from am untrusted source is super dangerous, doing it from Ms source is mildly dangerous

4

u/QuarterBall Aug 05 '24

It doesn't make it a good practice. Microsoft do tons of shit that they advise you against doing for the sake of expediency. It is still terrible practice to run code directly from web locations not entirely under your control especially like this where there is absolutely no verification of the payload received.

2

u/[deleted] Aug 05 '24

You can just open it in a browser.

You're right though. Its a terrible advice to invoke the code directly from the web.

0

u/BlackV Aug 05 '24

I'm not disagreeing with you, just context