33 lines
654 B
Batchfile
33 lines
654 B
Batchfile
@echo off
|
|
rem Wrapper so the helper runs regardless of the machine execution policy.
|
|
rem
|
|
rem agent.cmd STATUS
|
|
rem agent.cmd "PS Get-Date"
|
|
rem agent.cmd -Status
|
|
rem agent.cmd -Command "HOST_LIST"
|
|
|
|
setlocal
|
|
|
|
if "%~1"=="" goto usage
|
|
|
|
set "FIRST=%~1"
|
|
if "%FIRST:~0,1%"=="-" goto asflag
|
|
|
|
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0agent-cli.ps1" -Command %*
|
|
goto end
|
|
|
|
:asflag
|
|
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0agent-cli.ps1" %*
|
|
goto end
|
|
|
|
:usage
|
|
echo Usage:
|
|
echo agent.cmd STATUS
|
|
echo agent.cmd "PS Get-Date"
|
|
echo agent.cmd -Status
|
|
echo agent.cmd -Command "HOST_LIST"
|
|
exit /b 1
|
|
|
|
:end
|
|
exit /b %ERRORLEVEL%
|