From the course: PowerShell 7 Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Ternary operators

Ternary operators - PowerShell Tutorial

From the course: PowerShell 7 Essential Training

Start my 1-month free trial

Ternary operators

- [Instructor] So, when we're building the flow, we often want to build objects to use with all the values that we have from later on. So how does that work if we're using PowerShell 7? Now of course, everything I've showed you so far will work in PowerShell 7 and every other version of PowerShell. Now what's unique here is that we have something in here called Ternary Operators. A ternary operator is a way of combining all of these things together. So I'm going to show you this. So we'll paste this in here. Now, what you'll see is we have the variable names of messageOne, messageTwo, messageThree, and then we have the matched and the non-matched messages. Now what we don't have is the actual comparison or the tests. So I'm going to go up to here and we'll copy that one and we'll paste it directly into here. We'll then do the next one. And then we'll go through, once we have them all in, and explain what's taking place…

Contents