Make PowerShell Talk / Speak

Have you ever run a long PowerShell script, minimized it, only to realize much later that an error caused it to stop? Rather than just using a color syntax red to display the error, I wanted to hear it so I could switch back to the PowerShell window and see the error.

Now, if we want to write a function to generate to use whenever needed we could do so just like below. You might notice we used a global:functionName, this will allow the function to be in the global scope. If you don’t know what the global scope is, then just use, you’ll probably want it rather than not.