Does anyone know how to hide the powershell windows from the displaying in
the taskbar?
command I am executing:
powershell -NoProfile -Noninteractive -command ".\installer.ps1
installer.xml;exit $LASTEXITCODE"
if ($args.count -ne 1) {write-host "Requires 1 Argument, exiting...";sleep
2; break}
$a = (get-item -ea silentlycontinue $args[0]).fullname
if ($a -eq $null) {write-host "$($args[0]) is not a valid location,
exiting...";sleep 2;break}
# Specifies a set of values that are used when you start a process.
$si = new-object System.Diagnostics.ProcessStartInfo
$si.fileName = "powershell.exe"
$si.Arguments= "-nologo -command `"$($a)`""
$si.WorkingDirectory = $pwd
# this will launch the process in the background (hidden)
$si.windowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
# run process under alternate credentials
# $si.UserName="username"
# $si.Password="Password"
# start the process
$process = New-Object System.Diagnostics.Process
$process.startInfo=$si
# this is also valid
# $process = [System.Diagnostics.Process]::Start($si)
# close notepad and watch the output
#if($process.start()) { $process.waitForExit(); "existed"}
$process.start()