Run a PowerShell Script Step

This step executes a PowerShell script.

You can pass two user-provided parameters to the script, the path to inputPropFile and the path to outputPropFile. This enables the script to read and write values to those files that can be used later on, for example in next process step.

In the following example, the PowerShell plugin gets the first three lines from inputPropsFile and writes them to outputPropFile using the parameters args[0] and args[1].

    #get 3 lines from inputPropsFile# 
    $InputProps = get-content $($args[0]) | select -first 3 
    Write-Host "InputProps" 
    $InputProps    
    
    #set 3 lines from outputPropsFile# 
    set-content $($args[1]) $InputProps 
    $OutputProps = get-content $($args[1]) 
    
    Write-Host "OutputProps" 
    $OutputProps 
    

Required properties:

Property Name Description
Script Enter the script code to execute. A Java properties file for output properties to upload to the server can be accessed using args[0] and another containing all the input properties can be accessed using args[1].
PowerShell Command Path The absolute path to the PowerShell executable. Leave it blank if it's on the path.

Optional properties: None