Skip to content

Commit 400567a

Browse files
author
Captain Chicky
authored
fixed
1 parent 7fab163 commit 400567a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Set Powershell execution policy via batch at start.cmd

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ echo AllSigned --^> AS
7676
echo RemoteSigned --^> RS (recommended^)
7777
echo Unrestricted --^> UR
7878
echo Bypass --^> BY (not recommended^)
79-
SET /P "choice=Your choice?..."
80-
IF /I "%choice%" == "RT" (
79+
set /P "choice=Your choice?..."
80+
if /I "%choice%" == "RT" (
8181
goto RT
82-
) else IF /I "%choice%" == "AS" (
82+
) else if /I "%choice%" == "AS" (
8383
goto AS
84-
) else IF /I "%choice%" == "RS" (
84+
) else if /I "%choice%" == "RS" (
8585
goto RS
86-
) else IF /I "%choice%" == "UR" (
86+
) else if /I "%choice%" == "UR" (
8787
goto UR
88-
) else IF /I "%choice%" == "BY" (
88+
) else if /I "%choice%" == "BY" (
8989
goto BY
9090
) else (
91-
ECHO "%choice%" is not a valid choice. Please type one of the given two letter shorthands for the execution level(capitalization doesn't matter^).
91+
echo "%choice%" is not a valid choice. Please type one of the given two letter shorthands for the execution level(capitalization doesn't matter^).
9292
pause
9393
cls
9494
goto Start
@@ -98,38 +98,38 @@ IF /I "%choice%" == "RT" (
9898
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Restricted -Force}"
9999
echo Success, PowerShell Execution Policy set to
100100
powershell -command "& {Get-ExecutionPolicy}"
101-
echo cmd will now close in 10 seconds.
101+
echo Command prompt will now close in 10 seconds.
102102
timeout 10
103103
exit
104104

105105
:AS
106106
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy AllSigned -Force}"
107107
echo Success, PowerShell Execution Policy set to
108108
powershell -command "& {Get-ExecutionPolicy}"
109-
echo cmd will now close in 10 seconds.
109+
echo Command prompt will now close in 10 seconds.
110110
timeout 10
111111
exit
112112

113113
:RS
114114
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force}"
115115
echo Success, PowerShell Execution Policy set to
116116
powershell -command "& {Get-ExecutionPolicy}"
117-
echo cmd will now close in 10 seconds.
117+
echo Command prompt will now close in 10 seconds.
118118
timeout 10
119119
exit
120120

121121
:UR
122122
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force}"
123123
echo Success, PowerShell Execution Policy set to
124124
powershell -command "& {Get-ExecutionPolicy}"
125-
echo cmd will now close in 10 seconds.
125+
echo Command prompt will now close in 10 seconds.
126126
timeout 10
127127
exit
128128

129129
:BY
130130
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Force}"
131131
echo Success, PowerShell Execution Policy set to
132132
powershell -command "& {Get-ExecutionPolicy}"
133-
echo cmd will now close in 10 seconds.
133+
echo Command prompt will now close in 10 seconds.
134134
timeout 10
135135
exit

0 commit comments

Comments
 (0)