Advertisement
rj07thomas

Download latest version of PowerShell

Jun 14th, 2023
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. Clear-Host
  2.  
  3. $NewPSVer = Read-Host "Please enter version number"
  4.  
  5. $downloadFile = "https://github.com/PowerShell/PowerShell/releases/download/v$NewPSVer/PowerShell-$NewPSVer-win-x64.msi"
  6.  
  7. $newFile = "PowerShell-$newPSVer-win-x64.msi"
  8. $Output = "C:\Support\PowerShell-$newFile"
  9. $webClient = New-Object System.Net.WebClient
  10. $webClient.DownloadFile($downloadFile,$Output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement