Get-WmiClassMethodsAndWritableWmiProperties.ps1

This script returns a listing of implemented WMI methods and writable WMI Properties for all WMI classes in a particular WMI namespace. By default it searches the root/cimv2 namespace, but this is configurable.

 
 
 
 
 
(0)
Add to favorites
3/9/2011
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Other useful attributes
    1 Posts | Last post March 10, 2011
    • Included all properties, not just viewable, and included Type and IsArray attributes of Properties.
      
      
      [string]$divider = "="*80
      [string]$sColor = "Green"
      [string]$uColor = "darkGreen"
      
      [string]$computer = "."
      
      Get-WmiObject -List -Namespace "root\cimv2" -computer $computer | sort Name | % {
          if(!$_.Name.contains("__")){
              Write-Host -ForegroundColor $sColor $_.name
              Write-Host -ForegroundColor $uColor $divider
              $_.properties | where {$_.Qualifiers.Name -ne 'Abstract'} | ft @{Label="PROPERTIES"; Expression={$_.Name}; Align="Left"; Width=30;}, `
                  @{Label="Type"; Expression={$_.Type}; Align="Left"; Width=10;}, `
                  @{Label="IsArray"; Expression={$_.IsArray}; Align="Left"; Width=8;}
              $_.methods | where {$_.Qualifiers.Name -ne 'Abstract'} | ft @{Label="METHODS"; Expression={$_.Name}; Align="Left"; Width=30;}
          }
      }