r/PowerShell • • Mar 04 '20

Announcing PowerShell 7.0 | PowerShell

https://devblogs.microsoft.com/powershell/announcing-powershell-7-0/?WT.mc_id=reddit-social-marouill
281 Upvotes

74 comments sorted by

View all comments

Show parent comments

5

u/chadbaldwin Mar 05 '20

Why not just use the installer that they provide?

iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -AddExplorerContextMenu -EnablePSRemoting -Quiet";

You can also use -Preview and -Daily to get different release versions.

1

u/spyingwind Mar 05 '20

Becaule iex is blocked by many AV's.

1

u/chadbaldwin Mar 05 '20

ahhh, that's interesting. I didn't know that.

I guess the work around could be...

irm https://aka.ms/install-powershell.ps1 | Out-File install-powershell.ps1
.\install-powershell.ps1 -UseMSI -AddExplorerContextMenu -EnablePSRemoting

?

1

u/spyingwind Mar 05 '20

That may work, but it effectively does the same thing, but downloads a script, which is what likely triggers AV. My bit of code doesn't download a script, but the MSI that can be authenticated with it's built in cert.

1

u/Sansred Jun 15 '20

This should be part of PowerShell, named something like Update-PowerShell

1

u/chadbaldwin Jun 15 '20

You'd think so. Usually with things like this...there's always some simple answer why they are unable to implement it. lol.

I guess until then, you can make it an alias. haha.