- PowerShell Tutorial
- PowerShell - Home
- PowerShell - Overview
- PowerShell - Environment Setup
- PowerShell - Cmdlets
- PowerShell - Files and Folders
- PowerShell - Dates and Timers
- PowerShell - Files I/O
- PowerShell - Advanced Cmdlets
- PowerShell - Scripting
- PowerShell - Special Variables
- PowerShell - Operators
- PowerShell - Looping
- PowerShell - Conditions
- PowerShell - Array
- PowerShell - Hashtables
- PowerShell - Regex
- PowerShell - Backtick
- PowerShell - Brackets
- PowerShell - Alias
- PowerShell Useful Resources
- PowerShell - Quick Guide
- PowerShell - Useful Resources
- PowerShell - Discussion
Powershell - Comparison Operators Examples
The following scripts demonstrates the comparison operators.
> $a = 10 > $b = 20 > $a -eq $b False > $a -ne $b True > $b -gt $a True > $b -ge $a True > $b -lt $a False > $b -le $a False > $a = "mahesh" > $b = "suresh" > $a -like '*ahe*' True > $a -notLike '*ahe*' True > $b -match '[h$]' True > $b -notMatch '[h$]' False > $a = 'abc' > $b = 'abc' > $b -contains $a True > $b -notContains $a False
powershell_operators.htm
Advertisements