Collections:
Other Resources:
Comparison Operations in Windows PowerShell Scripts
How to use comparison operations in Windows PowerShell scripts? Can I write "$a > 0"?
✍: FYIcenter.com
No, you can not use "$a>0" as a comparison operation in Windows PowerShell scripts. You must use PowerShell comparisonoperators given below:
-eq Equal -ne Not equal -ge Greater than or equal -gt Greater than -lt Less than -le Less than or equal
Here are some examples of how to use PowerShell comparisonoperators:
$a = 2 $b = 3 "Is a < b? "+($a -lt $b) "Is a <= b? "+($a -le $b) "Is a > b? "+($a -gt $b) "Is a >= b? "+($a -le $b) "Is a == b? "+($a -eq $b) "Is a != b? "+($a -ne $b)
⇒ Logical Operations in Windows PowerShell Scripts
⇐ Invoke Object Methods in Windows PowerShell Scripts
2016-10-30, 1647🔥, 0💬
Popular Posts:
What is the scheduled task "\OneDrive Standalone Update Task-S-1-..." on my Windows 7 computer? "\On...
What is service "AeLookupSvc" on Windows Vista? "AeLookupSvc" is a system service with the display n...
A new tab called "Boot" is added in "msconfig" tool on Windows Vista and Windows 7. What is this "Bo...
Where to find tutorials on using Windows 8 Security? Here is a collection of tutorials on Windows 8 ...
How do I copy customized media information for my files to my new computer? When you add or edit med...