PowerShell: Operators Cheat Sheet

$a = 2The basic variable assignment operator
$a += 1Incremental assignment operator
$a -= 1Decrement assignment operator
$a -eq 0Equality comparison operator
$a -ne 5Not-equal comparison operator
$a -gt 2Greater than comparison operator
$a -lt 3Less than comparison operator
$FirstName = 'Trevor'

$FirstName -like 'T*'
Perform string comparison using the -like operator, which supports the wildcard (*) character. Returns $true

Leave a Reply

Your email address will not be published. Required fields are marked *