I got this part of a script
| Where {$_.property = statement}
I would like to add another value so that it has to match both values, so the command is going to work kinda like this
| Where {$_.property -eq statement} & {$_.anotherproperty -eq anotherstatement}
anyone who can help?
Another way to get an Excel IF to test multiple conditions is by using an array formula. To complete an array formula correctly, press the Ctrl + Shift + Enter keys together. In Excel 365 and Excel 2021, this also works as a regular formula due to support for dynamic arrays.
The multiple IF conditions in Excel are IF statements contained within another IF statement. They are used to test multiple conditions simultaneously and return distinct values. The additional IF statements can be included in the “value if true” and “value if false” arguments of a standard IF formula.
Logical and is done using -and
in powershell:
| Where {$_.property -eq statement -and $_.anotherproperty -eq anotherstatement}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With