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.