Skip To Content
PowerShell Gallery
Toggle navigation
Packages
Publish
Documentation
Sign in
Search PowerShell packages:
Posh
0.1.7
TipsAndTricks/TernaryOperator.Tip.ps1
# In PowerShell 7, there's a ternary operator.
# Let's use it to toss a coin
$CoinToss
=
(
Get-Random
)
%
2
?
'Heads'
:
'Tails'
$CoinToss