Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Execute a PowerShell Script from SSIS

Tags:

Does anyone know how to execute a PowerShell script from SSIS? I have created the script and it works from from the command line. The script takes a couple of command line parameters, which work fine when called from cmd.exe.

I'm using an Execute Process Task in SSIS and cannot get the script file to execute. I'm using expressions to pass in the name of the script and the command line arguments. The task is returning an incomplete string token error.

like image 923
Ed Mays Avatar asked Mar 03 '09 04:03

Ed Mays


1 Answers

From VS to launch PSH with an extra script (for a Cmdlet project) I use the following commandline:

powershell -noexit -command ". ./Startup.ps1"

The -noexit will keep the instance around (so you wouldn't want that), putting all the real commands in a script to be dot-sourced avoids a really long command line.

like image 191
Richard Avatar answered Sep 30 '22 16:09

Richard