May 2007
Beginner
320 pages
8h 23m
English
To more easily modify the Where clause in a script, substitute the Where clause with a variable. This configuration can be modified to include command-line input as well. This is shown in the ListSpecificWhere.ps1 script.
ListSpecificWhere.ps1
$strComputer = "."
$wmiNS = "root\cimv2"
$strWhere = "'ipc$'"
$wmiQuery = "Select * from win32_Share where name="+$strWhere
"Properties of Share named: " + $strWhere
$objWMIServices = Get-WmiObject -computer $strComputer `
-namespace $wmiNS -query $wmiQuery
$objWMIServices |
Format-List -property [a-z]*Q. | To limit the specific data returned by a query, what WQL technique can be utilized? |
A. | The Where clause of the WMIquery argument is very powerful in limiting the specific data ... |
Read now
Unlock full access