Created
August 11, 2017 09:20
-
-
Save johnmmoss/cb833726ba80b8d280cea609bfa6cc1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$currentPsVersion = (get-host).Version.Major; | |
if ((get-host).Version.Major -ge 4) { | |
write-host Powershell version $currentPsVersion is already installed -ForegroundColor Red | |
return; | |
} | |
$ps4DownloadUrl = "http://download.microsoft.com/download/3/D/6/3D61D262-8549-4769-A660-230B67E15B25/Windows6.1-KB2819745-x64-MultiPkg.msu" | |
$ps4LocalPath = "$env:temp\ps4.msu" | |
$wusaPath = "$env:windir\System32\wusa.exe" | |
((New-Object System.Net.WebClient).DownloadFile($ps4DownloadUrl, $ps4LocalPath)) | |
$command = "$wusaPath $ps4LocalPath /quiet /norestart" | |
iex ($command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment