IssueRaiser

Powershell -WindowStyle Hidden still shows a window briefly

<!-- If it is a bug report: - make sure you are able to repro it on the latest released version. You can install the latest version from https://github.com/PowerShell/PowerShell/releases - Search the existing issues. - Refer to the [FAQ](../docs/FAQ.md). - Refer to the [known issues](../docs/KNOWNISSUES.md). - Fill out the following repro template If it's not a bug, please remove the template and elaborate the issue in your own words. --> Steps to reproduce ------------------ In Windows Run dialog type this: `PowerShell.exe -WindowStyle Hidden -Command ping www.microsoft.com` Expected behavior ----------------- There should be no window, right now you can't start powershell without window flashing, making it rather useless e.g. for scheduled tasks. *Note* I think this is intended behavior, but it's confusing and new option is probably required. If you search how to run a powershell in scheduled task, the go-to workaround is to do a *vbs* script of all things! Such as: ``` Dim shell,command command = "powershell.exe -nologo -File D:\myscript.ps1" Set shell = CreateObject("WScript.Shell") shell.Run command,0 ``` This is not a good thing, powershell needs this feature in the shell itself, scheduled tasks are important feature and having a window flash on scheduled task is a really bad experience. Actual behavior --------------- It flashes the powershell window briefly. Environment data ---------------- <!-- provide the output of $PSVersionTable --> ```powershell > $P

Posted by Ciantic on Jan 22, 2017, 6:49 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

onboarding (Software)

Powershell -WindowStyle Hidden still shows a window briefly

CianticJan 22, 2017, 6:49 PM

<!-- If it is a bug report: - make sure you are able to repro it on the latest released version. You can install the latest version from https://github.com/PowerShell/PowerShell/releases - Search the existing issues. - Refer to the [FAQ](../docs/FAQ.md). - Refer to the [known issues](../docs/KNOWNISSUES.md). - Fill out the following repro template If it's not a bug, please remove the template and elaborate the issue in your own words. --> Steps to reproduce ------------------ In Windows Run dialog type this: `PowerShell.exe -WindowStyle Hidden -Command ping www.microsoft.com` Expected behavior ----------------- There should be no window, right now you can't start powershell without window flashing, making it rather useless e.g. for scheduled tasks. *Note* I think this is intended behavior, but it's confusing and new option is probably required. If you search how to run a powershell in scheduled task, the go-to workaround is to do a *vbs* script of all things! Such as: ``` Dim shell,command command = "powershell.exe -nologo -File D:\myscript.ps1" Set shell = CreateObject("WScript.Shell") shell.Run command,0 ``` This is not a good thing, powershell needs this feature in the shell itself, scheduled tasks are important feature and having a window flash on scheduled task is a really bad experience. Actual behavior --------------- It flashes the powershell window briefly. Environment data ---------------- <!-- provide the output of $PSVersionTable --> ```powershell > $P

Comments (0)

No comments yet. Start the discussion.

Comment on this issue