@echo off REM ============================================================================ REM Deploy-WinRM-HTTPS.bat REM Deploys WinRM HTTPS configuration to a shopfloor PC REM ============================================================================ echo. echo ======================================== echo WinRM HTTPS Deployment echo ======================================== echo. REM Check for administrator privileges net session >nul 2>&1 if %errorLevel% neq 0 ( echo [ERROR] This script requires Administrator privileges. echo Please right-click and select "Run as Administrator" echo. pause exit /b 1 ) echo [OK] Running with Administrator privileges echo. REM Get the directory where this batch file is located set "SCRIPT_DIR=%~dp0" echo Script directory: %SCRIPT_DIR% echo. REM Check if Setup-WinRM-HTTPS.ps1 exists if not exist "%SCRIPT_DIR%Setup-WinRM-HTTPS.ps1" ( echo [ERROR] Setup-WinRM-HTTPS.ps1 not found in script directory echo Please ensure all files are copied from the network share echo. pause exit /b 1 ) REM Check if certificate exists if not exist "%SCRIPT_DIR%wildcard-*.pfx" ( echo [ERROR] Wildcard certificate PFX not found in script directory echo Please ensure the certificate file is present echo. pause exit /b 1 ) echo [OK] Required files found echo. REM Execute PowerShell script echo Executing WinRM HTTPS setup... echo. PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command ^ "& '%SCRIPT_DIR%Setup-WinRM-HTTPS.ps1' -CertificatePath '%SCRIPT_DIR%wildcard-logon-ds-ge-com-20251017.pfx' -Domain 'logon.ds.ge.com'" if %errorLevel% neq 0 ( echo. echo [ERROR] Setup failed with error code: %errorLevel% echo. pause exit /b %errorLevel% ) echo. echo ======================================== echo [SUCCESS] WinRM HTTPS Setup Complete echo ======================================== echo. pause