You can run the WMI Explorer search and query features in Windows PowerShell. This feature helps you to automate your WMI queries and to learn the equivalent Windows PowerShell commands.
In this section:
WMI Explorer includes a fully-featured Windows PowerShell console in its Windows PowerShell pane. You can use the console to run any Windows PowerShell scripts and commands, import modules, and export objects.
The version of PowerShell in the Windows PowerShell pane is determined by the version that you have installed in Windows ($pshome\PowerShell.exe). If you update the version of PowerShell in Windows, such as by installing a Windows Management Framework update or a KB update, the version in the PowerShell console in WMI Explorer is updated automatically. Because they use the same executable file, they'll always match.
NOTE: The Windows PowerShell console is added, not hosted, so it uses the same Windows PowerShell profile as the standard Windows PowerShell console, Microsoft.PowerShell_profile.ps1. To run a session without your profile, in the Windows PowerShell pane of WMI Explorer (or any Windows PowerShell console), at the prompt, type:
powershell.exe -noprofile
To start a new session of Windows PowerShell console in WMI Explorer:
You can run any WMI Explorer query in the PowerShell console in WMI Explorer.
To run a query:
WMI explorer runs the query in the Windows PowerShell console.
To save the output of the command (or any part of the command in a variable, in the console, use the up-arrow to recall the last command. Then, edit the command line.
NOTE: To run a Get-CimInstance command for the Win32_Computer class on the local computer, omit the ComputerName parameter.
After testing a query in WMI Explorer, you might want to add it to a script that you're writing in a Windows PowerShell editor, such as PowerShell Studio.
To get the equivalent Windows PowerShell command for a query:
Copy PowerShell Code copies the Windows PowerShell command to your Windows clipboard. To paste the command in a standard Windows PowerShell console, right-click.
To paste the command in most other documents and editors, including the PowerShell console in WMI Explorer, right-click and select Paste or type Ctrl+V.
After pasting the command in the PowerShell console in WMI Explorer, you can edit the command. For example, you can use the Select-Object cmdlet to specify property names, instead of using the Format-Table cmdlet. The result is a custom object (PSCustomObject) that you can pipe to other cmdlets.
Get-CimInstance -ComputerName SAPIEN01 -ClassName Win32_LogicalDisk | Select-Object -Property DeviceID, Caption
The PowerShell console in WMI Explorer appears in the Windows PowerShell tab in the Output Pane. By default, the Output Pane and its tabs appear at the bottom of the WMI Explorer window.
To display the PowerShell console:
To hide the PowerShell console:
To hide the Output pane (and all of its tabs):
This manual guides you through the features of WMI Explorer. If you have questions that aren't answered here, search the SAPIEN Blog and the WMI Explorer forum (for licensed users) or the Trial Software Questions forum (trial users). If you can't find what you need, post a question on either forum. We'll get back to you quickly.