The Ternary Cometh
Developers are likely to be familiar with ternary conditional operators as they’re legal in many languages (Ruby, Python, C++, etc). They’re also often used in coding interviews to test an applicant as they can be a familiar source of code errors. While some developers couldn’t care less about ternary operators, there’s been a cult following waiting for them to show up in Powershell. That day is almost upon us.
Any Powershell developer can easily be forgiven for scratching their heads and wondering what a ternary is. In the most basic sense a ternary evaluates an expression to a binary result and carries out one of two possible outcomes. Lets start by looking at some code examples:
