Google

2011-09-02

Find your Video Driver version with PowerShell

Well, I wrote this quite sometime ago (Bonus for geeks! Can you tell from the driver version?) but apparently forgot to post it:

Here is one way you can use WMI and PowerShell to get the version of driver you have installed for your video card(s).

PS C:\> gwmi win32_VideoController |select DeviceID,Name,DriverVersion |ft -a

DeviceID         Name                      DriverVersion
--------         ----                      -------------
VideoController1 ATI Radeon HD 5700 Series 8.812.0.0
VideoController2 ATI Radeon HD 5700 Series 8.812.0.0

gwmi is shorthand for get-wmi.
I happen to have two ATI cards. It's not really necessary to select Device ID and name. You can simplify it as follows:

PS C:\> (gwmi win32_VideoController)[0].DriverVersion
8.812.0.0

Why parentheses? Because that way you can access the properties of an object.

Why [0]? Well, b/c it's an array and you know you have the same card. So, it's enough to get driver version of the first card.

How did I know that I have to use Win32_VideoController WMI class? Well, I did not but there is no black magic here, just a bit of guess work and good ol' trial & error:

PS C:\> gwmi -list |?{$_ -match "video"}


   NameSpace: ROOT\cimv2

Name                                Methods              Properties
----                                -------              ----------
CIM_VideoBIOSElement                {}                   {BuildNumber, Caption, CodeSet, Description...}
CIM_VideoController                 {SetPowerState, R... {AcceleratorCapabilities, Availability, CapabilityDescripti...
CIM_PCVideoController               {SetPowerState, R... {AcceleratorCapabilities, Availability, CapabilityDescripti...
Win32_VideoController               {SetPowerState, R... {AcceleratorCapabilities, AdapterCompatibility, AdapterDACT...
CIM_VideoBIOSFeature                {}                   {Caption, CharacteristicDescriptions, Characteristics, Desc...
CIM_VideoBIOSFeatureVideoBIOSEle... {}                   {GroupComponent, PartComponent}
CIM_VideoSetting                    {}                   {Element, Setting}
Win32_VideoSettings                 {}                   {Element, Setting}
CIM_VideoControllerResolution       {}                   {Caption, Description, HorizontalResolution, MaxRefreshRate...
Win32_VideoConfiguration            {}                   {ActualColorResolution, AdapterChipType, AdapterCompatibili...

No comments: