@@ -14,6 +14,10 @@ Describes chaining pipelines with the `&&` and `||` operators in PowerShell.
1414
1515## Long description
1616
17+ > [ !NOTE]
18+ > This is an experimental feature. For more information see
19+ > [ about_Experimental_Features] ( about_Experimental_Features.md ) .
20+
1721Beginning in PowerShell 7, PowerShell implements the ` && ` and ` || ` operators to
1822conditionally chain pipelines. These operators are known in PowerShell as
1923* pipeline chain operators* , and are similar to
@@ -26,7 +30,10 @@ The `&&` operator executes the right-hand pipeline, if the left-hand pipeline
2630succeeded. Conversely, the ` || ` operator executes the right-hand pipeline if
2731the left-hand pipeline failed.
2832
29- This can be use for conditional execution of software deployments. For example:
33+ These operators use the ` $? ` and ` $LASTEXITCODE ` variable to determine if a
34+ pipeline failed. This allows you to use them with native command and not just
35+ with cmdlets or functions. This can be use for conditional execution of
36+ software deployments. For example:
3037
3138``` powershell
3239npm run build && npm run deploy
@@ -35,10 +42,6 @@ npm run build && npm run deploy
3542In this example the ` npm run deploy ` command only runs if the build command
3643succeeds.
3744
38- > [ !NOTE]
39- > This is an experimental feature. For more information see
40- > [ about_Experimental_Features] ( about_Experimental_Features.md ) .
41-
4245### Examples
4346
4447#### Two successful commands
0 commit comments