PowerShell Tutorial 8 : ForEach Loops [Beginners]
Ғылым және технология
Loops in PowerShell, Foreach loops in this video, we take a look at the 3 different versions of the foreach loop and compare them to iterative version of code, in the next video we will go over the other kinds of loops in powershell like the for, while, do-while, do-until loops.
Playlist : • PowerShell Tutorials
Tags:
Powershell
scripting
coding
Loops
Foreach
Пікірлер: 17
Well done. Very clear explanations. Keep up the good work.
These guides are excellent! Thank you so much for putting your time into it.
@jackedprogrammer
Жыл бұрын
No problem glad your enjoying the videos :)
Intresting!!
Thank you very much !!! I can clear quest because of you thank you !!
@user-uh5km8zj6e
Жыл бұрын
I subscribe to you thank you !
@jackedprogrammer
Жыл бұрын
Thank you! :) glad you're enjoying the videos :)
Thanks a lot😊
@jackedprogrammer
2 жыл бұрын
No problem glad you enjoyed the video :)
Thanks alot. But can someone explain where the variable $Name came from in the foreach section. I do not see where/when the $Name variable was created. Only $Names, $filepath, $current has been created. How does the script know what to do with $Name. Thanks!
@jackedprogrammer
Жыл бұрын
The $Name variable is created with the foreach loop the foreach loop goes through all the items in $Names one at a time assigning it to $Name I hope this helps :)
Nice videos
@jackedprogrammer
2 жыл бұрын
Thank you, glad you're enjoying the videos :)
@rajeshsura189
2 жыл бұрын
@@jackedprogrammer if your ok can we have online sessions on powershell
Is anyone able to explain why the original filepath variable is pointing to names.txt? Then the $Names vaiable is using get content on that filepath. Doesn't that just get the content of the text inside the Names.txt file?
in the first method, how is the variable $Name working if we never set it up before? Am I missing something?
@bdatony
Жыл бұрын
You can call it whatever you want. It is the name of the "Iteration". It is a variable for what ever 🙂 You can call $EachStuffFromNames instead. The variable is kind of created itself within the foreach-statement.