Hi , Instead of placing all my code in the main loop, I wanted to create a SUBLOOP . Then call the subloop from the main loop.
For example in Winbatch, I could call a subloop with "GoSub" and use the "Return" statement to return back to the main loop.
How would I do something similar in Powershell?
The nearest thing to your description is to create a function and call that. I'd suggest very strongly that you take the time to investigate how PowerShell works – if you just port over the way you do things in other languages you can end up with very inefficient code