I'm working around an annoyance with the Win 10 start menu that can't handle multiple shortcuts (start menu tiles) to the same executable command. I want to have individual start menu items to open named PuTTY sessions using PuTTY -load SessionName
So, I have created a small powershell (PS) script file for each session like:
# ----Open named PuTTY session----
$PF= ${Env:ProgramFiles}
$exe= "Other\PuTTY\putty.exe"
$session= "Servername (login)"
$PuTTY= Join-Path $PF $exe
& $PuTTY -load $session
I can then create a shortcut to this script, with the shortcut target set to-
powershell.exe <path to ps1 script file>
and pin the shortcut to the start menu.
This works well, but as the script runs you can see a powershell console window flick open and then close as the script runs. I want to get rid of this annoying flicker of the PS console window.
I have experimented with adding the -WindowStyle Hidden
and/or -NonInteractive
options to the command line in the shortcut, but the annoying flicker of the powershell console still happens.
I would have expected -WindowStyle Hidden
to make PS run in the background with no display window. Is that not the case? or is there another way to achieve a truly "invisible" PS script?