Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Powershell activity output returning blank value

DanielCordick
Mega Patron
Mega Patron

I am running a custom power shell activity and the output result is returning a blank value, when i run the same power shell script on my dev and test instance the output returns the desired value, i moved it to prod and now the output is blank. totally lost on this,  i know my PS script works because i get an output on dev and test

1 ACCEPTED SOLUTION
7 REPLIES 7

Hi,

I know this is kind of weird but can you test the powershell activity alone in production.


Just try to execute below script and test if this works:

$env:computerName

 

This should give you your mid server name back.

Thanks,
Ashutosh 

running $env:computerName i received 

"hresult": null,
"output": "\nMID-PROD-001\n",
"errorMessages": null,
"debugMessages": null,
"credentialDebugInfo": "2020-03-23 13:07:10 Tried Credential: name=sn_mid, affinity: yes, status=success, sysid=ae807b336f50220048ed9c0cbb3ee453, username=sn_mid, type=Windows, order=100\r\n",
"eccSysId": "3f78c2ecdb37c0108eb7776b8c961907",
"tags": {
"__text__": "\nMID-PROD-001\n"
}
}

 

when i move to run the command i want i receive 

COMMAND: (Get-AdmPwdPassword -ComputerName ${activityInput.DeviceName}).Password 

 

{
"hresult": null,
"output": "\n",
"errorMessages": null,
"debugMessages": null,
"credentialDebugInfo": "2020-03-23 13:15:24 Tried credential: MID service account, status=success\r\n",
"eccSysId": "986a82a0db77c0108eb7776b8c96198b",
"tags": {
"__text__": "\n"
}
}

 

 

Chandra Suvro 1
Kilo Explorer

Hi Danny

 

I have a similar issue did you find any solution? If yes please share with me