Skip to content

Commit cbbf3a6

Browse files
authored
Update README.md
1 parent ab6695c commit cbbf3a6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
This vbscript will run powershell.exe hidden; since [`-WindowStyle Hidden` isn't sufficient](https://github.com/PowerShell/PowerShell/issues/3028). Hopefully we'll have [a `pwshw.exe` soon](https://github.com/PowerShell/PowerShell/issues/3028#issuecomment-367169480) and this repo can be antiquated.
1+
This vbscript will run powershell.exe hidden; since [`-WindowStyle Hidden` isn't sufficient](https://github.com/PowerShell/PowerShell/issues/3028).
2+
Hopefully we'll have [a `pwshw.exe` soon](https://github.com/PowerShell/PowerShell/issues/3028#issuecomment-367169480) and this repo can be antiquated.
23

34
You're probably here because you've already realized that using [PowerShell's `-WindowStyle Hidden` parameter](https://docs.microsoft.com/en-us/powershell/scripting/core-powershell/console/powershell.exe-command-line-help#parameters) without this script, doesn't completely hide the powershell console.
45

@@ -10,12 +11,13 @@ You're probably here because you've already realized that using [PowerShell's `-
1011
wscript.exe HiddentPowershell.vbs -ExecutionPolicy ByPass -File "C:\Program Files\Get-HelloWorld.ps1"
1112
```
1213

13-
This Will run Powershell in a completely hidden console by calling PoweRShell like this:
14+
This Will run Powershell in a completely hidden console by calling PowerShell like this:
1415
```
1516
powershell.exe -ExecutionPolicy ByPass -File "C:\Program Files\Get-HelloWorld.ps1"
1617
```
1718

1819
I recommend that you also pass the `-WindowStyle Hidden` parameter, so that the executing powershell script knows that it's hidden.
20+
You may also want to include the `-NonInteractive` parameter for the same reason.
1921

2022
If you have machines that have Windows Scripting Host (WSH) file extensions (like `.vbs`) disassociated from WSH; then you will need to add the `//E:vbscript` parameter:
2123
```
@@ -24,7 +26,9 @@ wscript.exe //E:vbscript HiddentPowershell.vbs ...
2426

2527
# Logging
2628

27-
Logging is done to *Event Viewer*. There will be two events for every run of the script. One at the start of the run, and the other at the completion/finish. The details of the logs are:
29+
Logging is done to *Event Viewer*.
30+
There will be two events for every run of the script. One at the start of the run, and the other at the completion/finish.
31+
The details of the logs are:
2832

2933
- **Event Path:** `Windows Logs\Application`
3034
- **Source:** `WSH`
@@ -35,7 +39,8 @@ Logging is done to *Event Viewer*. There will be two events for every run of the
3539

3640
## Start
3741

38-
The *Event ID* of the *starting* message will always be `4` (informational). Here's an example of what that will look like:
42+
The *Event ID* of the *starting* message will always be `4` (informational).
43+
Here's an example of what that will look like:
3944

4045
```
4146
HiddenPowershell Running:
@@ -45,7 +50,8 @@ HiddenPowershell Running:
4550

4651
## Finish
4752

48-
The *Event ID* of the *finished* message will be `0` (success). If powershell exits with a non-zero exit code, the *Event ID* will be `1` (error).
53+
The *Event ID* of the *finished* message will be `0` (success).
54+
If powershell exits with a non-zero exit code, the *Event ID* will be `1` (error).
4955

5056
Here's an example of what a *success* looks like; *Event ID* is `0`:
5157
```

0 commit comments

Comments
 (0)