22REM ========================================================
33REM DeployWorkstation.bat
44REM Launcher for DeployWorkstation.ps1
5- REM Version 5.1 – PNWC Edition
5+ REM Version 5.1 - PNWC Edition
66REM ========================================================
77
88setlocal enabledelayedexpansion
@@ -12,16 +12,14 @@ echo ===== DeployWorkstation Launcher v5.1 =====
1212echo .
1313
1414REM --------------------------------------------------------
15- REM 1) Elevation check
16- REM Re-launch this .bat elevated if not already admin.
15+ REM 1) Elevation check - re-launch elevated if not admin
1716REM --------------------------------------------------------
1817net session > nul 2 >& 1
1918if %errorlevel% neq 0 (
2019 echo Requesting administrative privileges...
2120 echo Please click " Yes" in the UAC prompt.
2221 echo .
23- powershell.exe -NoProfile -Command ^
24- " Start-Process -FilePath '%~f0 ' -Verb RunAs -Wait"
22+ powershell.exe -NoProfile -Command " Start-Process -FilePath '%~f0 ' -Verb RunAs -Wait"
2523 exit /b
2624)
2725
@@ -85,29 +83,14 @@ if "%choice%"=="1" (
8583)
8684
8785REM --------------------------------------------------------
88- REM 5) Show what will run, then launch
86+ REM 5) Show parameters then launch
8987REM --------------------------------------------------------
9088if " !ps_params! " == " " (
9189 echo Parameters : (none - full run)
9290) else (
9391 echo Parameters : !ps_params!
9492)
9593echo .
96- echo Verifying script integrity...
97- REM Pass path via env var so PS resolves it — avoids CMD delayed-expansion
98- REM mangling of '!' characters in folder names (e.g. Deploy!v5.1\).
99- set " DEPLOY_PS1 = %~dp0 DeployWorkstation.ps1"
100- powershell.exe -NoProfile -Command ^
101- " $p=$env:DEPLOY_PS1;$null=[System.Management.Automation.Language.Parser]::ParseFile($p,[ref]$null,[ref]$e);if($e){$e|ForEach-Object{Write-Host('SYNTAX ERROR: '+$_.Message)};exit 1}"
102- set " DEPLOY_PS1 = "
103- if %errorlevel% neq 0 (
104- echo .
105- echo [ERROR] DeployWorkstation.ps1 has syntax errors - please re-download.
106- echo .
107- pause
108- goto :error_exit
109- )
110-
11194echo Starting Windows PowerShell 5.1...
11295echo .
11396
@@ -146,5 +129,6 @@ REM --------------------------------------------------------
146129:normal_exit
147130popd
148131echo .
149- pause
132+ echo Press any key to close...
133+ pause > nul
150134exit /b 0
0 commit comments