PowerShell 支持以下比較運算符:
運算符 說明 示例 t/f
------------ --------------------- ------------------------ -----
-eq 等於 10 -eq 10 true
-ne 不等於 10 -ne 10 false
-gt 大於 10 -gt 10 false
-ge 大於 10 -ge 10 true
或等於
-lt 小於 10 -lt 10 false
-le 小於或等於 10 -le 10 true
-like 通配符比較 "one" -like "o*" true
-notlike 通配符比較 "one" -notlike "o*" false
-match 正則表達式 "book" -match "[iou]" true
比較
-notmatch 正則表達式 "book" -notmatch "[iou]" false
比較
裝載至http://my.oschina.net/u/251121/home