Powered by GeSHi

Source code for getres.ps1

(view source code of getres.ps1 as plain text)

  1. # WMI query to list all properties and values of the Win32_DisplayConfiguration class
  2. # This PowerShell script was generated using the WMI Code Generator, Version 1.30
  3. # http://www.robvanderwoude.com/updates/wmigen.html
  4.  
  5. param( [string]$strComputer = "." )
  6.  
  7. $colItems = get-wmiobject -class "Win32_DisplayConfiguration" -namespace "root\CIMV2" -computername $strComputer
  8.  
  9. foreach ($objItem in $colItems) {
  10. 	write-host "Device Name                    :" $objItem.DeviceName
  11. 	write-host "Pels Width                     :" $objItem.PelsWidth
  12. 	write-host "Pels Height                    :" $objItem.PelsHeight
  13. 	write-host "Bits Per Pel                   :" $objItem.BitsPerPel
  14. 	write-host "Display Frequency              :" $objItem.DisplayFrequency
  15. 	write-host
  16. }
  17.