Problems executing Powershell Script from Workflow

sgreer2002's picture

I have a VBscript that runs in a workflow using the execute batch file component.  Within the VBscript I use the following line to execute a small powershell script.

Set objShell = CreateObject("Wscript.Shell")
objShell.Run("powershell.exe -noprofile -command D:\temp\DataAreaCreate.ps1" & " " & "'" & DataArea & "'" & " " & readDL & " " & updateDL)

The VBscript runs fine without the Powershell script when pubished.  When I run the vbscript in debug mode and call the Powershell script it executes fine.  The problem I have is when I Publish the workflow - the Powershell Script fails to execute and there is no exception fired off.

So it works fine in Debug mode but not when Published.

Anyone have any ideas?

reecardo's picture

You may/may not have answered

You may/may not have answered your own question:

https://www-secure.symantec.com/connect/forums/pub...

sgreer2002's picture

Nope

This is the same workflow.  The vbscripts execute flawlessly.  The same VBscript calls powershell and works great in debug.  Powershell is the only thing that fails when Published.

reecardo's picture

Just curious... can you

Just curious... can you supply the full path to the powershell.exe in the command line (i.e. "C:\woo hoo\powershell.exe" -noprofile ... ) ? Or add the path to power shell in the system paths of the machine?

sgreer2002's picture

Wow - Such a simple solution.

I was looking to hard!  Thanks reecardo!  I put the full path in the script to the powershell executable and voila!  Issue if fixed when published.