PowerShell: Automating Administrative Tasks
by Michael Shepard, Chendrayan Venkatesan, Sherif Talaat, Brenton J.W. Blawat
And / OR comparison operators
The –and and –or comparison operators are used to evaluate multiple expressions present within a single line of code. These are used to see whether two or more expressions evaluate to be True. The –and comparison operator mandates that both evaluations must evaluate to be True to proceed in the statement. This means that expression1 and expression2 must be True to continue. The –or comparison operator only requires one of the two expressions to be True. This means that expression1 or expression2 can be True to continue. As you are learning PowerShell, you will want to use caution while using the -and and -or comparison operators as they can quickly complicate the logic of your scripts.
A script that shows how to use ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access