PowerShell inline If (IIf)

后端 未结 7 2016
独厮守ぢ
独厮守ぢ 2020-12-07 16:24

How do I create an a statement with an inline If (IIf, see also: Immediate if or ternary If) in PowerShell?

If you also think that this should be a native Po

7条回答
  •  一个人的身影
    2020-12-07 17:16

    PowerShell doesn't have support for inline ifs. You'll have to create your own function (as another answer suggests), or combine if/else statements on a single line (as another answer also suggests).

提交回复
热议问题