Execute WQL with PowerShell

Use PowerShell to run WQL.

John Savill

July 29, 2014

1 Min Read
PowerShell command prompt

Q: How can I use PowerShell to query WMI Query Language?

A: If you want to use PowerShell to run a WMI Query Language (WQL) statement, you can use the following approach in which you replace $query with your own WQL statement:

$query = 'select TotalPhysicalMemory from Win32_ComputerSystem'get-wmiobject -query $query -Namespace "rootCIMV2"

 

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like