Find Patches on Windows Box - ShivanandaNayak/Test GitHub Wiki

$session = [activator]::CreateInstance([type]::GetTypeFromProgID(‘Microsoft.Update.Session’))
$us = $session.CreateUpdateSearcher()
$qtd = $us.GetTotalHistoryCount()
$hot = $us.QueryHistory(0, $qtd)
$KBStatus2 = @()
foreach ($Upd in $hot) {
$KB = New-Object -Type PSObject -Prop @{
‘HotFixName’=$Upd.Title
‘UpdateDate’=$Upd.date
} | Where-Object { ($_ -Like “Windows”)}
$KBStatus2 += $KB
}

$KBStatus2

⚠️ **GitHub.com Fallback** ⚠️