Get Driver Versions in PowerShell

Using win32_PnpSignedDriver class of the WMI object

To get driver versions in PowerShell, use win32_PnpSignedDriver class of the WMI object.

After running the command, your PowerShell should give you an output something like this:
Get Driver version in PowerShell

Note how the columns are arranged as Device Name, Device Version, and Description. If you are to write the command in any sequence, the results will be the same but order will change. Here’s the output if you write it in a different order:

Get Driver versions in PowerShell -  Get-WmiObject

You can further customize the command for simplicity. For instance, remove the Description by using:

OR

What is Get-WmiObject?

WMI means "Windows Management Instrumentation". The Get-wmi cmdlet is used to retrieve information on available WMI classes as well as instances of WMI classes.

Using Get-CimInstance cmdlet

If you have PowerShell 6.0 or above you can also use the Get-CimInstance cmdlet instead of, Get-WmiObject.
Firstly, start by checking your PowerShell Version by using the following command:

You can check your version details from the following output:
PSVersionTable output
If everything checks out, use the command:

OR

Your PowerShell should show a similar output:
Get-CimInstance  Output
Remember that you can always filter out drivers against their versions by using SELECT.
For example:

gcim Output

Conclusion

PowerShell essentially serves as a task automation solution. Being made of scripting language, configuration management framework, and command-line shell, you can use PowerShell to check information regarding your device alongside executing other functions.In this article, we learned the two ways of how to get driver versions in PowerShell. These methods are Get-WmiObject (gwmi) and Get-CimInstance (gcim).

Both are followed by win32_PnpSignedDriver to retrieve information. You expand this command by using SELECT to retrieve description and driver version.
So, here’s a summary of commands:

Command Purpose Filters
Get-WmiObject Win32_PnPSignedDriver Retrieve information on available WMI classes as well as instances of WMI classes. | select Devicename, Driverversion, Description
gwmi Win32_PnPSignedDriver Same as above Same as above
Get-CimInstance win32_PnpSignedDriver Retrieve information on CIM instances. In the end same data as WMI. | select Devicename, Driverversion, Description
gcim win32_PnpSignedDriver Same as above Same as above
$PSVersionTable Retrieve PowerShell Version information

That’s all about how to get driver versions in PowerShell.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *