in many cases PowerShell uses different operators than VBScript, and it uses some operators differently. The following table provides a summary of these operators:
In VBScript… | Purpose… | In PowerShell… |
---|---|---|
= | Assignment | = |
= | Equality test | -eq |
> | Greater than | -gt |
< | Less than | -lt |
>= | Greater than or equal to | -ge |
<= | Less than or equal to | -le |
True | Boolean True | $true |
False | Boolean False | $false |
AND | Boolean AND | -and |
NOT | Boolean NOT | -not |
OR | Boolean OR | -or |
AND | Binary AND | -band |
OR | Binary OR | -bor |
NOT | Binary NOT | -bnot |
&, + | String concatenation | + |
Refer to Chapter 6 to review the discussion of the additional operators offered in PowerShell.