Skip to Content
Former Member
Mar 07, 2014 at 11:44 AM

using exec() for running powershell script in BODS 4.1



I am trying to run a powershell script by calling it within BODS script using exec(),

$Time_stamp=exec('PowerShell.exe','\Droptest\ora\test\oracle\cron\etl\scripts\GetTimeStamp.PS1', 8);

print( 'TIME_STAMP-1 IS '||$Time_stamp);

When i run the job, it get hang at this exec function & then I have to kill the job from the "monitor" tab of dataservices.

After killing the job, in the trace log it shows the result for the print as " 99: 20140306001502".

Ideally the script should retun the timestamp "20140306001502". The script file is perfect as when I run this script from the cmd prompt of powershell then it returns the correct value.

So I am facing 2 problems,

1) The job gets hang at the above exec function

2) what is the correct syntax of exec() for running the powershell script so that it returns the correct value without getting hang.