Navigation:  IM Sequencer > Schedule tasks > Triggers > Custom trigger  >

Powershell trigger

Previous pageReturn to chapter overviewNext page

 

The Powershell trigger is a custom trigger, and specifically build for Powershell. This trigger executes a Powershell script or command to determine if it needs to trigger.

 

       General setting
       All general custom trigger settings are described below, to develop your own trigger plugin read more here.

 

Type
 
The Powershell trigger is called "Traxion.IM.Scheduler.Plugins.Powershell.PowershellTrigger"

 

Parameters

 
The following parameters apply for the Powershell trigger.

 

Script file
This points to a Powershell script with the extension *.ps1, you can configure this or use the Script text parameter

 

Direct execute script
If you configured the Script file parameter then the contents will be read from the file and then executed, when you set this to true the Script file will be started directly without reading the contents.

 

Script text
This can contain the direct Powershell commands to be executed, you can configure this or use the Script file parameter

 

Script parameters
The parameters that need to be provided to the Powershell script file, this does not apply for the Script text parameter
The parameter format is like "encryption=true;remote=false;url=http://localhost", multiple parameters are splitted using ';', if the parameter has no value ommit the '=' and only provide the parameter name.

 

Custom shouldTrigger variable
You can set this global variable to indicate that it needs to trigger, set a global variable name like this "$global:<variableName>" in your Powershell command where the variable name is the same as the value configured for the "Custom shouldTrigger variable" parameter. The value can be set to a integer (0 or 1) or to a boolean value ($true or $false).
 
If this variable is not used then the trigger will trigger if the Powershell result was "0", indicating nothing went wrong.

 

Custom state variable 1 to 5
If you need to keep track off specific variables you can set these variables to a specific value, the IM Sequencer will set this global variable before the Powershell command is started and stores the result afterwards, set or get a global variable name like this "$global:<variableName>" in your Powershell command where the variable name is the same as the value configured for the "Custom  state variable1 to 5" parameter.

 

Script credential variables

       If the script needs to have a specific username or password it can be configured and stored encrypted, this way you do not need to store the username/password in the script directly.

       You can access the configured username and password via the global variables like "$global:ScriptUserName" for the username and "$global:ScriptUserPassword" for the password.

 

Bypass execution policy
Set to true to bypass the powershell execution policy for this trigger only. You can also disable or change the powershell execution policy on the system by opening a powershell console using administrator rights and type 'Set-ExecutionPolicy Unrestricted', see https://technet.microsoft.com/en-us/library/ee176961.aspx for more information about the powershell execution policy.
 
 
                               Powershell trigger type settings

 


Page url: http://www.traxionsolutions.com/imsequencer/help/index.html?powershelltriggertype.htm