I am writing a powershell script to be called by the OEC. In the config.yml file, I see the globalArgs line, but I dont know if these are specified by me, or is there a set of acceptable terms. How are these arguments then accessed within my powershell script? Finally, is there anything I need to configure in the tool, on the OEC integration page?
Hi Connor,
Sorry for the delayed response, firstly I should mention that passing args is not the optimal way to pass data from OEC to the PowerShell scripts, rather use "globalFlags" to declare key value pairs that are passed to PowerShell as named parameters with corresponding values.
Here is an example of how to set 3 parameters in config.yml:
apiKey: xxxxx-xxxxxxxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxx
baseUrl: https://api.opsgenie.com
logLevel: debug
globalFlags:
parameter1: value1
parameter2: value2
parameter3: value3
actionMappings:
...
...
Here is an example of how to use these parameters in PowerShell:
param([string]$payload,
[string]$apiKey,
[string]$opsgenieUrl,
[string]$logLevel,
[string]$parameter1,
[string]$parameter2,
[string]$parameter3
)
echo $parameter1
echo $parameter2
echo $parameter3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.