這裏是我用於搜索WSUS安裝的Windows更新的代碼,我想爲重新啓動掛起/完成的狀態添加一列。有沒有開關?安裝Windows更新後檢查重新啓動狀態的Powershell
$Session = New-Object -ComObject "Microsoft.Update.Session"
$Searcher = $Session.CreateUpdateSearcher()
$historyCount = $Searcher.GetTotalHistoryCount()
$Searcher.QueryHistory(0, $historyCount) | Select-Object Date,
@{name="Operation"; expression={switch($_.operation){
1 {"Installation"}; 2 {"Uninstallation"}; 3 {"Other"}}}},
@{name="Status"; expression={switch($_.resultcode){
1 {"In Progress"}; 2 {"Succeeded"}; 3 {"Succeeded With Errors"};
4 {"Failed"}; 5 {"Aborted"}
}}}, Title | Out-GridView
我不認爲我們有任何檢查重啓狀態的特定開關。我認爲我們必須明確地檢查 –