Hide PowerShell Console from a GUI

PowerShell is a very powerfull scripting language that allows you to build many useful tools using command lines.

For a better interactivity, it’s also possible to build a graphical user interface (GUI) allowing to pilot these tools.

By default, when a PowerShell script containing a GUI is run, the user interface is displayed of course, but the console too !

The following script block allows to hide the PowerShell console: