This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

alert Trigger Actions with powershell script

Hi, first time posting here...

THE SITUATION:

I've configured alert Trigger Actions in NPM, calling an external ps1 script.

Arguments are passed to the script just fine, script executes just fine...

TrigActions.png

The script itself contains…

.

$Account=$args[0]

$InstalledProduct=$args[1]

$Client = $args[2]

$Caption = $args[3]

.

THE PROBLEM: If an input variable is multi-word, the blank spaces cause the values 'bleed' into the next argument. 

For example, if $args[2] is "ABC Incorporated" then the script will read this as...

$Client = ABC

$Caption = Incorporated

THE QUESTION:

How can I make the script ignore the blank spaces in $args[2] such that 

$Client = ABC Incorporated

?

I'm NOT a ps expert, I'm sure I'm missing something obvious. 

I suspect it has to do with syntax of the command, which looks like this...

...path\TicketCreate.ps1" "${N=SwisEntity;M=CustomProperties.AT_CustomerID}" "${N=SwisEntity;M=CustomProperties.AT_CI_ID}" "${N=SwisEntity;M=CustomProperties.Client}" "${N=SwisEntity;M=Caption}"....

any pointers are much appreciated.

thank you.