PowerShell Comparison Operators

 

Here you will find a list of the PowerShell comparison operators available to you in the Windows PowerShell console.

 

For example if you want to find all the process information for PowerShell you can run the following in the PowerShell console:

 

Gps | Where-Object {$_.Name -Eq "Powershell"}

 

Comparison Operators:

 

-Lt Less than

-Le Less than or equal to

-Gt Greater than

-Ge Greater than or equal to

-Eq Equal to 

-Ne Not Equal to

-Like Like wildcard pattern matching

-NotLike Not like wildcard pattern matching

-Match Regular expression pattern matching

-NotMatch Regular expression pattern matching

 

Published Sunday, January 28, 2007 1:21 PM by dhite
Filed under:

Comments

No Comments