Traditionally, while writing scripts, we have used regular console output, also known as print-style debugging. This often leads to a lot of text in the output. Of course, this can be cleaned up once the scripting is complete, but that is still additional work, not to mention the need to add all of the debug output again during further development, changes, or extension. Also, as the complexity of the script increases, so does the complexity of debugging using console text.
Enter: the extensive built-in debugging capabilities of PowerShell.
Write a debug output for the New-File function that you created in the previous chapter.