update powershell 5 to 7 code example Example: upgrade powershell to 7.1.1 command line iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"