Probably the simplest and most flexible way to download and install PowerShell 7 for Windows users is to run the following one-liner:
Invoke-RestMethod -Uri https://aka.ms/install-powershell.ps1 | New-Item -Path function: -Name Install-PowerShell | Out-Null
It creates a new cmdlet Install-PowerShell with a number of useful parameters. For example, to download the latest production version of PowerShell 7 as a portable app in a folder of your choice, run this:
Install-PowerShell -Destination c:\ps7test -AddToPath
If you prefer to install PowerShell 7 as a managed MSI application, run this instead:.
Install-PowerShell -UseMSI -Quiet
Note: A truly quiet installation requires Administrator privileges.
ReTweet this Tip!
Why Invoke-RestMethod vs Invoke-WebRequest?
Powered by IDERA