@echo off REM ============================================================================ REM Test-WinRM-HTTPS.bat REM Tests WinRM HTTPS setup on local computer REM ============================================================================ echo. echo ======================================== echo WinRM HTTPS Test Script 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 Test-WinRM-HTTPS-Setup.ps1 exists if not exist "%SCRIPT_DIR%Test-WinRM-HTTPS-Setup.ps1" ( echo [ERROR] Test-WinRM-HTTPS-Setup.ps1 not found in script directory echo Please ensure all files are copied from the network share echo. pause exit /b 1 ) echo [OK] Required files found echo. REM Execute PowerShell script echo Running WinRM HTTPS test... echo. PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command ^ "& '%SCRIPT_DIR%Test-WinRM-HTTPS-Setup.ps1'" if %errorLevel% neq 0 ( echo. echo [ERROR] Test failed with error code: %errorLevel% echo. pause exit /b %errorLevel% ) echo. echo ======================================== echo [SUCCESS] Test Complete echo ======================================== echo. pause