PowerShell Ternary Operator (a ? b : c) and Other Question Mark Operators
PowerShell 7 added a ternary operator, condition ? valueIfTrue : valueIfFalse, that returns one of two values in a single expression. It’s the short form of if/else, and here it picks a status and a singular or plural word: Output: It doesn’t exist in Windows PowerShell 5.1, so I’ll show the 5.1 equivalents too. The … Read more