Skip to content

Instantly share code, notes, and snippets.

@marufeuille
Created October 2, 2016 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marufeuille/a8eb62e9f06d1887b1d7350702f7a3fb to your computer and use it in GitHub Desktop.
Save marufeuille/a8eb62e9f06d1887b1d7350702f7a3fb to your computer and use it in GitHub Desktop.
$zippath = "c:\PSWindowsUpdate.zip"
Invoke-WebRequest "https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc/file/41459/43/PSWindowsUpdate.zip" -Outfile $zippath
$zipfile = (new-object -com shell.application).Namespace($zippath)
$destinationPath = "$env:WINDIR\System32\WindowsPowerShell\v1.0\Modules"
$destination = (new-object -com shell.application).Namespace($destinationPath)
$destination.CopyHere($zipfile.Items())
Import-Module PSWindowsUpdate
Get-WUInstall -AcceptAll -IgnoreReboot -AutoSelectOn -Confirm
Remove-Item $zippath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment