All Releases : ESP WORKLOAD AUTOMATION
APPL MYAPP
/*POWERSHELL
/*DATA1 - Creates a variable named MYVAR and assigns a value of "DUMMY"
/*SETVAR - The script sets a new value for MYVAL.
/*USEVAR - job retrieves the value and passes it as an argument into the
/* script
DATA_OBJECT DATA1
SETVAR MYVAR='DUMMY'
ENDJOB
NT_JOB SETVAR
RUN ANY
AGENT MYAGENT
CMDNAME C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0\POWERSHELL.EXE
ARGS C:\Users\Administrator\Documents\Scripts\ESPMGR.ps1 -
"%ESPAPPL..%ESPAPGEN"
EXITCODE 5 FAILURE
RELEASE USEVAR
ENDJOB
NT_JOB USEVAR
VALUE = WOBDATA('DATA1','MYVAR')
RUN ANY
AGENT MYAGENT
CMDNAME C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0\POWERSHELL.EXE
ARGS /C C:\Users\Administrator\Documents\Scripts\test_args.ps1 -
%VALUE
ENDJOB
*************************************************************************************************
ESPMGR.ps1
*************************************************************************************************
Set-Location Env:
$APPLGEN = $args[0]
write-host "APPLGEN $APPLGEN"
$Env:ESPAPPLMGR = "name"
$Env:ESPAGENTDIR = "C:\Program Files\CA\WA Agent"
Get-ChildItem ESPAPPLMGR
Start-Process -NoNewWindow -FilePath "C:\Program Files\CA\WA Agent\ESPmgr.exe" -ArgumentList "DATA1/$APPLGEN/MAIN ACTION SET MYVAR(abcde)"
Start-Sleep -s 5
*************************************************************************************************
USEVAR powershell script to show the value of the argument that was passed in.
*************************************************************************************************
Set-Location Env:
$ARGS1 = $args[0]
write-host "ARGS1 $ARGS1"
Start-Sleep -s 10
ESPmgr command
WOBDATA statement