Hello,
I have a runbook that is associated with a new hire form from Service Manager. The runbook does a few things like getting and updating the original SR. The next step is a "Run .Net Script" with language type set to PowerShell. The only thing this does is create a string with all the important variables and returns it.
$String = 'Var1,Var2,Var3,Var4'
I then trigger a "Run Program" that calls the PowerShell script and passes in the parameter string from above. The code looks like this.
powershell.exe -c "D:\Scripts\MyScript.ps1 -MyParamString ""$String"""
Right now, the contents of the script are extremely simple. It basically takes that string, breaks it up and then writes the information to a log. I currently have two modules that it imports, a custom one and AD. The custom one is a logging module that I use regularly in other runbooks without issue.
The issue is that when I trigger the runbook, it would seem as though the script is running as it creates the log and does everything that I expect it to do. However, Orchestrator still shows the "Run Program" as running and doesn't seem to end (let it go for over 10 minutes before). I have tried a few different things but have been unable to figure out why it continues to be "running." I have tried replacing the PowerShell.exe with the full path (C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe) and messing with the quotes. If I run the script from powershell, it runs without issue.
Any ideas would be appreciated. Thank you.