50. <スクリプトによるWindows Update>
1. Windows Update Agent API
a. CreateObject(“Microsoft.Update.Session”)
b. https://gallery.technet.microsoft.com/scriptcenter/2e6d542c-
df53-4fae-ba84-43c200216c6a
c. https://yamanxworld.blogspot.com/2010/07/windows-scripting-
windows-update.html
2. WindowsUpdateProviderモジュール
a. http://www.atmarkit.co.jp/ait/articles/1808/22/news011.html
2018/09/01(土) みんなで情シス!第2回 50
1 $updates = Start-WUScan
2
if ($updates.Count -gt 0) {Install-WUUpdates -Updates $updates}
else {Write-Host "No update"}
3 if (Get-WUPendingUpdate) {Restart-Computer}