Link to home
Start Free TrialLog in
Avatar of grahamco
grahamcoFlag for United States of America

asked on

Filtering get-wmiobject results

I'm looking to get a list of windows updates installed on a certain date. So far i found  powershell command that provides all updates now i'm trying to filter the results to display just the day in question. Here's what i have

provides list of all updates:  Get-WmiObject -class win32_quickfixengineering

I'm looking for just those installed on 10/24/2015. Here is the command i'm running but i'm not receiving any results nor am i receiving an error. I used "like" because the installedon field contains the time as well.

Get-WmiObject -class win32_quickfixengineering | where-object {$_.Installedon -like "10/24/2015"}
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of grahamco

ASKER

I'm getting this error when running the command. I altered the date as i manually uninstalled the 10/24 updates after posting the question.

Get-WmiObject : Invalid query
At line:1 char:14
+ Get-WmiObject <<<<  -class win32_quickfixengineering -filter "Installedon -LIKE '3/12/2012%'"
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
In the WMI filter, the operator is "LIKE" (case doesn't matter).  It doesn't have a dash in front of it as opposed to the PowerShell "-like" comparison operator.
that worked thank you but you were correct not all updates are being displayed. I see way more installed  when viewing them via add/remove programs. Is there another wmi class that i need to search to see those?
From what I recall, no.  The most complete list can be had from that WMI query and the registry.  Check out the Technet Script Gallery - I'm pretty sure someone has already done this.