I just started learning Powershell. Can somebody please explain to me or give me the exact name for these: -gt, -like, etc. I just tried to Google them but can't find the proper link for explanation.
Thank you very much!
These are called comparsion operators.
-gt
Greater than.
Example:
PS C:\> 8 -gt 6
True
PS C:\> 7, 8, 9 -gt 8
9
-Like
Match using the wildcard character (*).
Example:
PS C:\> "Windows PowerShell" -like "*shell"
True
PS C:\> "Windows PowerShell", "Server" -like "*shell"
Windows PowerShell
A Google search for Powershell comparison operators finds the Powershell documentation page:
https://technet.microsoft.com/en-us/library/hh847759.aspx
Windows PowerShell includes the following comparison operators:
-eq
-ne
-gt
-ge
-lt
-le
-Like
-NotLike
-Match
-NotMatch
-Contains
-NotContains
-In
-NotIn
-Replace
By default, all comparison operators are case-insensitive. To make a comparison operator case-sensitive, precede the operator name with a "c". For example, the case-sensitive version of "-eq" is "-ceq". To make the case-insensitivity explicit, precede the operator with an "i". For example, the explicitly case-insensitive version of "-eq" is "-ieq".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With