Find patch from SYSTEMINFO output using PoSH


If I go to Windows Powershell and type SYSTEMINFO, I am listed the patches/hotfixes installed on my machine (amongst other things).

For instance:

 [174]: KB980232
 [175]: KB980396
 [176]: KB980408
 [177]: KB980846
 [178]: KB981013
 [179]: KB981332
 [180]: KB981852
 [181]: KB981889
 [182]: KB982018

I would like a Powershell command that will search the above and tell me if a certain entry exists (e.g. KB982018). I'm not sure if this is possible though.
Who is Participating?
slidingfoxConnect With a Mentor Commented:
Get-Hotfix | Where { $_.HotFixID -match "KB982018" }

Open in new window

$STORE -match "KB982018"

If this KB value is there in SystemInfo, that entire line will be displayed, like:
[55]: KB982018

If this KB value is not there, there will be no output.
richlionelAuthor Commented:
Thanks all, slidingfox's answer is the exactly what I was looking for.

Thanks to everyone else.
All Courses

From novice to tech pro — start learning today.