MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PowerShell/comments/fd46oj/new_powershell_version_v700/fjfzklj
r/PowerShell • u/PowerShellChallenge • Mar 04 '20
70 comments sorted by
View all comments
Show parent comments
3
What's the chain operator do?
5 u/halbaradkenafin Mar 04 '20 Run the second command only if the first succeeds. I use it a lot in the command line for git commit && git push and similar 2 u/rjmholt Mar 04 '20 There are two of them in fact, the other is ||.|| will run the second command if the first fails:icacls .\ex.txt /setowner doesntexist || Write-Error "Did not set file owner"
5
Run the second command only if the first succeeds. I use it a lot in the command line for git commit && git push and similar
git commit && git push
2
There are two of them in fact, the other is ||.
||
|| will run the second command if the first fails:
icacls .\ex.txt /setowner doesntexist || Write-Error "Did not set file owner"
3
u/Beirbones Mar 04 '20
What's the chain operator do?