Run a PowerShell script in the user context without a script window
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7e10bf2 Oct 26, 2018
Permalink
Failed to load latest commit information.
LICENSE Update comments and Readme Oct 26, 2018
PsRun.vbs Update comments and Readme Oct 26, 2018
README.md Typo Oct 26, 2018

README.md

PsRun

License Copyright Glen Buktenica

Running PowerShell scripts in a user context without any window being displayed at all is not possible.
The closest way is the WindowStyle hidden switch available from PowerShell version 2 onwards:

PowerShell.exe -WindowStyle hidden Run-Script.ps1

This will still display a temporary PowerShell window.
To completely remove the window from the use context use this vbs to call the PowerShell script:

wscript.exe PsRun.vbs Run-Script.ps1

The most common use case for this operation is a scheduled task that needs to run in the user context and needs to not display an annoying pop-up.