Finding Software Updates

by Apr 5, 2011

In Windows Vista/Server 2008, Microsoft introduced many new service and application specific log files. PowerShell can access those with Get-WinEvent. Here is  how useful the rich information can be in these logs. The function Get-SoftwareUpdates will create a list of software updates that your machine received.  While this does not cover the usual Hotfixes (use Get-Hotfix for those), the list will clearly show which installed software packages received updates:

function Get-SoftwareUpdates {
  $filter = @{
    logname='Microsoft-Windows-Application-Experience/Program-Inventory'
    id=905
  }

  Get-WinEvent -FilterHashtable $filter |
  ForEach-Object {
    $info = 1 | Select-Object Date, Application, Version, Publisher
    $info.Date = $_.TimeCreated
    $info.Application = $_.Properties[0].Value
    $info.Version = $_.Properties[1].Value
    $info.Publisher = $_.Properties[2].Value
    $info
  }
}

 

Twitter This Tip!
ReTweet this Tip!