August 9th, 2012

PowerTip: Using Parameters with the Get-WmiObject PowerShell Cmdlet

Doctor Scripto
Scripter

Summary: Use parameters with the Get-WmiObject cmdlet Question: Which parameter of the Get-WMIObject cmdlet takes the place of a WQL where clause?

Answer: The filter parameter takes the place of the WQL where clause as shown here: 
Get-wmiobject win32_logicaldisk –filter “drivetype  =  3” Question: Which parameter of the Get-WMIObject cmdlet takes the place of a WQL select statement?

Answer: The property parameter takes the place of the WQL select statement as shown here: 
Get-WmiObject  win32_bios -Property name, version Question: Which parameter of the Get-WmiObject cmdlet permits you to use a native WQL query?

Answer: The query parameter of the Get-WmiObject cmdlet accepts a native WQL query as shown here:
Get-WmiObject -Query “Select name, version from win32_bios”

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback