How to pass parameters to powershell function from ecc queue payload

san1989
Giga Guru

Hi All,

I can find below examples of sending parameters from payload  to PowerShell scripts as individual arguments. But I am not able to find sending parameters to function inside the PowerShell script like  "function (param1, param2)"

Please help me syntax.

example:

ecc.payload = '<?xml version="1.0" encoding="UTF-8"?><parameters><parameter name="name" 
  value="'+value+'"/><parameter name="skip_sensor" value="true"/></parameters>';

 

3 REPLIES 3

AJ-TechTrek
Giga Sage
Giga Sage

Hi @san1989 ,

 

Refer the below article, which may helps you.

 

https://www.servicenow.com/community/itom-articles/automated-data-import-using-mid-server-and-powers...

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.

 

Thank You

AJ - TechTrek with AJ

Linkedin:- https://www.linkedin.com/in/ajay-kumar-66a91385/

YouTube:- https://www.youtube.com/@learnitomwithaj

ServiceNow Community Rising Star 2024

san1989
Giga Guru

HI this is related to execute the file, I just need to send the parameters to the function in the PowerShell script.

Can you please share any idea on that.

James Chun
Kilo Patron

Hi @san1989.

 

Have a read of the following articles:

Basically you can pass the parameters within the ECC's payload and parse them within your PS script.

 

Cheers