Databases Reference
In-Depth Information
$PSCulture
Culture of the current Windows PowerShell session
$PSEmailServer
Variable to hold the Email Server. This can be used instead of the HostName
parameter in the Send-MailMessage cmdlet.
$PSHOME
Parent folder of the host application of this Runspace
$PSUICulture
UI Culture of the current Windows PowerShell Session
$PSVersionTable Version information for current PowerShell session
$PWD
PowerShell Working Directory
$StackTrace
Detailed StackTrace for the last error
$TRUE
Boolean True
The most important variable to familiarize yourself with is $_ , which is the current object in the
pipeline. This is very handy when you want to iterate through all the items that are being sent
through the pipeline. The following example uses a Where-Object cmdlet to i lter the output on
every process that has been passed along the pipeline where the WorkingSet of the current process
in the pipeline is greater than 100MB:
Get-Process | Where-Object {$_.WorkingSet -gt 100MB}
Note that this example uses the -gt comparison operator. PowerShell provides a set of comparison
operators that need to be used when comparing objects. Table 14-3 lists the commonly used com-
parison operators.
TABLE 14-3: PowerShell Equality Operators
OPERATOR
DESCRIPTION
-eq
Equal to
-ne
Not equal to
-gt
Greater than
-ge
Greater than or equal to
-lt
Less than
-le
Less than or equal to
-like
Matches using the (*) wildcard
character
continues
Search WWH ::




Custom Search