Examples/AnyRepo/Repo/Prod/OS/Get-WindowsUpdates.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
param(
      [string]$ComputerName
)

[hashtable]$computer_name = @{}

if ($ComputerName) {
      $computer_name.Add('ComputerName', $ComputerName)
}

Get-CimInstance @computer_name -Class Win32_QuickFixEngineering -ea Stop |
    select HotFixID, Description, InstalledBy, InstalledOn |
        sort InstalledOn -Descending