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