Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: -or Returning a false positive ??

$
0
0

If you read about_Operators, -or is a Logical operator used to 'to connect conditional statements into a single complex conditional.' Comparison operators such as -contains, -like, -eq … are doing variable comparisons.

if (($foo -Contains 'X') -or ($foo -contains 'Z')) {Write-Output $foo}
if (($foo -Contains 'X') -and ($foo -contains 'Z')) {Write-Output $foo}


Viewing all articles
Browse latest Browse all 13067

Trending Articles