In Bash,
command1.sh || recover.sh
command2.sh && command3.sh
Does powershell offer a similar, tight, construct?
The closest I have come up with:
command1.ps1; if ($? -ne 0) { recover.ps1 }
command2.ps1; if ($? -eq 0) { command3.ps1 }
In Bash,
command1.sh || recover.sh
command2.sh && command3.sh
Does powershell offer a similar, tight, construct?
The closest I have come up with:
command1.ps1; if ($? -ne 0) { recover.ps1 }
command2.ps1; if ($? -eq 0) { command3.ps1 }
Powershell 7 has it https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-70?view=powershell-7#pipeline-chain-operators
1/0 || 'no'
RuntimeException: Attempted to divide by zero.
no