powershell2

PowerShell with WMI

Windows Management Instrumentation (WMI)
– WmiPrvSE – Process that runs WMI Providers
– wbemtest – integrated WMI tool in Windows, hit start and type wbemtest

PowerShell
Get-WmiObject # command for executing WMI operations within PowerShell, gwmi is shortcut

– List Namespaces in root: Get-WmiClass -namespace root -class __NAMESPACE
– List Namespaces in root\cimv2: Get-WmiClass -namespace root\cimv2 -class __NAMESPACE
– List Classes in Namespace: Get-WmiClass -namespace root\cimv2\power -list
– List Instances of a Class: Get-WmiClass -namespace root\cimv2\power -class Win32_PowerPlan

Scripting guy blog – big repository of usefull scripts, not only in PowerShell