Solved

workflow halts when it gets to Powershell script

  • 26 April 2022
  • 6 replies
  • 291 views

Userlevel 5
Badge +16

Pretty straightforward I am attempting to run a Powershell script from workflows using the 

ExecuteScript activity

 

The issue is that it simply halts when it gets to the script.

No error, nothing in the logs it just halts.

any ideas?

 

Batch files work just fine, and the executable path for Powershell is set

icon

Best answer by christopherlecky 27 April 2022, 00:43

View original

If you have a question or comment, please create a topic

6 replies

Userlevel 6
Badge +12

Not sure if this is your problem, but I always specify a Username and password to run the script and I always start it in a named directory:

 

 

Userlevel 5
Badge +16

I usually leave it empty for batch files and it works fine as it runs under the service context.

Userlevel 3
Badge +6

Is the powershell getting launched on the remote machine? Can you check cvd.log of the remote machine for any clues?

Userlevel 3
Badge +6

Is there any log entries in the EvMgrS log or CVD log on the client you are trying to run the powershell script on?

 

Userlevel 5
Badge +16

There is nothing in the EvMgrS log, but CVD has the following :

CreateProcessWithExplicitHandles() - Creating process with special handles. Ret:[122]

I googled it and that 122 error translates to ERROR_INSUFFICIENT_BUFFER, which seems to indicate that the arguments field is too long.

I’m going to drop some of them and see what happens.

Userlevel 5
Badge +16

I shortened the list of arguments and it eureka, it works.

The only arguments I used is 

-noprofile -noninteractive

Now it works.