I currently open my PowerShell script through a .bat file. The script has a GUI. I tried to put this in my script but it hid the GUI as well and also kept looping because I
In the solution proposed posted in a comment (*
Put it in a shortcut instead of in a batch file. Right click a blank spot on desktop or in a folder window, New, Shortcut, paste your line in, Next, name it, Finish
*.) to hide definitely the Command Prompt, I set, in the properties of the shortcut Run=minimized in General.