cancel
Showing results for 
Search instead for 
Did you mean: 

Execute a powershell script using BODS?

0 Kudos
1,057

Hi all,

Have created a script using PowerShell called script_unzip.ps1.

Can anyone pls help with the syntax to execute this in a BODS script.

I picture we have to use the exec() function, and I tried the below however it doesn't work. At times the job starts and gets stuck.


exec('cmd', '"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "\\path_path_path\script_unzip.ps1" -wait', 8);

All help will be appreciated.

Thank you.

-Sid

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

Exec() function executes the parameters by default in CMD, so there is no need to add cmd in arguments.

Write your code as you execute in CMD .

For ex: If I have to execute a bat file in cmd .

In system I go to cmd and then write the path .....C:\> (path)\filename.bat

so in DS the code will be

exec( '(path)\filename.bat','',8)

This will execute the file. similarly you can code for your requirement