Is there a || equivalent in PoSH?
If I was writing a batch script I could use || to kick off a second command, if the first command failed.
Anyone know offhand, if there is an equivalent in PowerShell?
Anyone know offhand, if there is an equivalent in PowerShell?
Comments
-
RobertKaucher Member Posts: 4,299 ■■■■■■■■■■If I was writing a batch script I could use || to kick off a second command, if the first command failed.
Anyone know offhand, if there is an equivalent in PowerShell?
I don't believe this is likely. I've never seen anything like that. The same thing can be done with try/catch, which would give you better ways of knowing why the command failed (a DNS error versus the path to the folder was not found) and then reacting to it depending on why.