Open PalmEmanuel opened 2 years ago
I had trouble coming up with very clear examples for all topics in #404 without making them very bloated or advanced, let me know if there's something that doesn't feel right!
Thanks for the PR! I haven't had the time to give this a thorough review yet, but I plan to shortly. 💖
Sorry for the delay in response. 🙂
PR Summary
Added a few examples in AboutLoopsAndPipelines regarding the
foreach
cmdlet alias vs loop and how thebreak
,continue
andreturn
keywords affect pipelines vs standard loops.Fixes #404
Context
No particular context or background for the PR, see issue for linked discussions and examples of topics.
Changes
Added a new
Context
to AboutLoopsAndPipelines called "Loops and Keywords" with 5 newIt
assertions to clarify some important things regarding pipeline loops vs keyword/standard loops.is possible to break a standard loop
- Showsbreak
in a normal loopis possible to skip iterations of a standard loop
- Showscontinue
in a normal loopis possible to return a value from a standard loop
- Showsreturn
in a normal loophas the same name but not the same behaviour
- Showsbreak
with a pipelineforeach
aliasreturns differently when used in a pipeline
- Showsreturn
with a pipelineForEach-Object
Checklist