Skip to content

Instantly share code, notes, and snippets.

View voidbar's full-sized avatar

Tomer Lev voidbar

View GitHub Profile
@MyITGuy
MyITGuy / example01.ps1
Last active January 22, 2023 12:23
PowerShell: Get-MicrosoftUpdates
$MicrosoftUpdates = Get-MicrosoftUpdates -IncludeDISM
$GetHotfixOnlyUpdates = $MicrosoftUpdates | ? {$_.Source.Count -eq 1 -and $_.Source -contains 'Get-Hotfix'}
$MicrosoftUpdateOnlyUpdates = $MicrosoftUpdates | ? {$_.Source.Count -eq 1 -and $_.Source -contains 'MicrosoftUpdate'}
$DismOnlyUpdates = $MicrosoftUpdates | ? {$_.Source.Count -eq 1 -and $_.Source -contains 'DISM'}
$GetHotfixUpdates = $MicrosoftUpdates | ? {$_.Source -contains 'Get-Hotfix'}
$MicrosoftUpdateUpdates = $MicrosoftUpdates | ? {$_.Source -contains 'MicrosoftUpdate'}
$DismUpdates = $MicrosoftUpdates | ? {$_.Source -contains 'DISM'}
$MissingFromGetHotfix = $MicrosoftUpdates | ? {$_.Source -notcontains 'Get-Hotfix'}