Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MSEndpointMgr/PSInvoker
Utility application to silently running PowerShell scripts without flashing windows.
https://github.com/MSEndpointMgr/PSInvoker
Last synced: 5 days ago
JSON representation
Utility application to silently running PowerShell scripts without flashing windows.
- Host: GitHub
- URL: https://github.com/MSEndpointMgr/PSInvoker
- Owner: MSEndpointMgr
- License: mit
- Created: 2024-04-09T11:59:41.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-04-17T15:36:21.000Z (7 months ago)
- Last Synced: 2024-08-01T17:15:18.369Z (3 months ago)
- Language: C#
- Homepage:
- Size: 178 KB
- Stars: 25
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PSInvoker
PSInvoker serves as a small utility application to allow for silently running PowerShell scripts without having a flashing window appearing. This comes in handy when administrators would like make use of PowerShell scripts running as scheduled tasks, without dealing a devastating blow to the end-user with annoying windows flashing by. To overcome this behavior, in the past it's been widely known to wrap the invocation of a PowerShell script in a VBScript, however Microsoft is now deprecating VBScript in Windows, leaving us without any non-intrusive way of automating tasks on our endpoints.
# Usage
PSInvoker is very simple to use. First of all, either clone this repository and build the executable yourself through e.g. Visual Studio, or download the compiled executable from the Releases section.
For any command line, e.g. in a scheduled task usage scenario, simply call PSInvoker.exe with the proper arguments.## Command line arguments
PSInvoker supports two command line arguments. The first argument is the full path of the PowerShell script file, e.g. C:\Scripts\Script.ps1. By default, PSInvoker is set to invoke the PowerShell script file using 'Bypass' as the execution policy. This can be overridden by using the -e (--ExecutionPolicy) command line argument, and pass in any of the supported values: AllSigned, Bypass, RemoteSigned, Restricted, Unrestricted. If you're keen on waiting for the PowerShell process to complete executing, use the -w (--Wait) switch.
## Examples
```cmd
> PSInvoker.exe
> PSInvoker.exe -w
> PSInvoker.exe -e RemoteSigned
> PSInvoker.exe --ExecutionPolicy RemoteSigned
> PSInvoker.exe --ExecutionPolicy RemoteSigned --Wait
```## Logging
PSInvoker writes to a log file placed in the %TEMP% folder called PSInvoker.log.
## Dependencies
PSInvoker requires .NET Framework 4.7.2 runtime.
## PowerShell support
It's currently only supported to invoke PowerShell 5.1 processes.