PowerShell
The PowerShell task (powershell
) allows user to run PowerShell 6 (or higher) scripts. Powershell must be installed on the system where Ianus is executed.
The script can be included in the task XML or referenced thru the attribute path.
Attribute | Type | Purpose |
---|---|---|
path | string | Path of the script to be executed |
Ianus API
Ianus API are available thru the following object instances
Object name | Class |
---|---|
$Env |
HPE.Ianus.Environment |
$Job |
HPE.Ianus.Job |
$Task |
HPE.Ianus.Task |
$Log |
HPE.Ianus.Log.LoggerFacade |
Example
<job multithread="false">
<powershell name="STEP01">
echo "I am PowerShell $($PSVersionTable.PSVersion)"
echo "In job $($Job.Name) and task $($Task.Name)"
</powershell>
<powershell name="STEP02" path="PowerShell.ps1"/>
</job>
Status codes
Status | Status code | Description |
---|---|---|
Ready | -1 | Task is initialized, but not yet started |
Running | -2 | Task is running |
Success | 0 | Task completed successfully |
Warnings | 1 | Task completed with warnings |
Errors | 2 | Task completed with errors |
Aborted | 9 | Task cannot be executed |