Code doesn't always go as planned. It would be great if we all could write code that works perfectly all the time but ultimately bugs will creep in and our code never works right the first time.
If you want to group parts of your code for debugging purposes or simple readability, the PowerShell ISE has the answer. Keeping your code organized is sometimes just as important as the code actually ...