Implement the && and || operators that bash has
Votes from Connect: 22
Original Date Submitted: 2/8/2013 8:32:38 AM
Description:
Contact Information
Handle: antize
Site Name: PowerShell
Feedback ID: 778798
Frequency: Always Happens
Regression: Yes, this happens in all previous versions
Problem Description:
Discussion about this at stackoverflow - http://stackoverflow.com/questions/563600/can-i-get-to-work-in-powershell
Jeffery Snover said to request it here so here I am :D
Here is a description of what they do -- http://www.gnu.org/software/bash/manual/bashref.html#Lists
An AND list has the form
command1 && command2
command2 is executed if, and only if, command1 returns an exit status of zero.
An OR list has the form
command1 || command2
command2 is executed if, and only if, command1 returns a non-zero exit status.
Product Studio item created by Connect Synchronizer due to creation of feedback ID 778798 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=778798).
Repro Steps:
Expected Results:
Internal BugId: 4111

2 comments
-
Anonymous commented
It's surely an overisght since I used this simple one line shorthand alternative to an if clause all the time in CMD scripts.
-
John B. commented
They are both in command prompt (cmd.exe), as well. Great shorthand I wish PowerShell had.