O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

20.7. Getting Information About Software

An important regular maintenance task is keeping all our software up to date. Of course, the most important piece of software is the operating system. We can use WMI to query the state of installed service packs and updates for all computers on the network and then trigger alarms when something is not up to date, just like we could for hardware queries.

20.7.1. Operating System Updates

The first thing that we may need to check is the operating system version and its installed service packs. We can get that from the Win32_OperatingSystem object for the current machine:

PS> gwmi Win32_OperatingSystem | ' select Name,Version,BuildNumber,' ServicePackMajorVersion,ServicePackMinorVersion | Format-List Name ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required