Hi Team,
I have the “Run .Net Script” activity in one of the Runbooks, Which actually runs a PowerShell commands to send the incident information to ServiceNow using REST web services. I need to pass the credentials for authentication purpose while making the web service call. The same shell script when I run independently, it is working fine as I supply the credentials during the runtime.
I need some information on “How to pass a runtime parameters to the Runbook”, which is a sensitive information in our case. Please share the information if anyone knows how to pass the runtime parameters.
Sample code:
$CRED=get-credential
$ResponseObject=Invoke-RESTMethod -Uri $URL method 'POST' -credential $CRED -body $JsonBody -ContentType 'application/json'
Error details:
While running the runbook, it is getting failed at $CRED statement with the error "Cannot process command because of one or more missing mandatory parameters: credential"
Regards,
Jansi


