Updating PowerShell to the latest or Preview release via REST method
- Latest stable version:
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') }"
- Latest Preview version
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -UseMSI -Preview"