Collections:
Other Resources:
Logical Operations in Windows PowerShell Scripts
How to use logical (or Boolean) operations in Windows PowerShell scripts? Can I write "$a > 0 AND $a < 10"?
✍: FYIcenter.com
No, you can not use "$a > 0 AND $a < 10" as a logical operation in Windows PowerShell scripts.
You must use PowerShell logical operators given below:
-and Logical AND -or Logical OR -not Logical NOT ! Logical NOT
Here are some examples of how to use PowerShell comparisonoperators:
$a = 2 $b = 3 "Is a < b and b < 10? "+($a -lt $b -and $b -lt 10) "Is a < b or b < 10? "+($a -lt $b -or $b -lt 10) "Is a not < b? "+(-not $a -le $b) "Is a not < b? "+(! $a -le $b)
⇒ If-Else Conditions in Windows PowerShell Scripts
⇐ Comparison Operations in Windows PowerShell Scripts
2016-10-30, ∼2585🔥, 0💬
Popular Posts:
What files are used by Windows Live Toolbar for Internet Explorer (IE) browser? How Alexa Toolbar is...
Where to get help on analyzing HijackThis log files? Analyzing HijackThis log files are not easy to ...
How to export Windows services to a text file? If you want to export services that are currently con...
What is the "McClientAnalytics.exe" process on windows 7? Is the "McClientAnalytics.exe" process a v...
How to use sc.exe command to create a new service? If you want to create a new service, you can use ...