Created
November 15, 2014 00:34
-
-
Save Jaykul/a0596ef62d04002fa233 to your computer and use it in GitHub Desktop.
Remote Windows Updates
This file contains 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
param( | |
[string[]]$ComputerName = ".", | |
[Parameter(Mandatory)] | |
[Management.Automation.Credential()] | |
[PSCredential]$Credential | |
) | |
$sessions = New-PSSession -ComputerName:$ComputerName -Credential:$Credential | |
Invoke-Command -Session $sessions { | |
$wua = New-Object -Com Microsoft.Update.Session | |
$search = $wua.CreateUpdateSearcher() | |
$result = $search.Search("Type='Software'") | |
$result.Updates | Where IsInstalled -eq $False | |
} | fl PSComputerName, Title, Description |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment