Executing an SSIS package stored in the package store or File System
In this recipe, we will execute an SSIS package using PowerShell.
Getting ready
In our recipe, we will execute Customer Package
, which is saved in the package store, and we will also execute the C:\SSIS\SamplePackage.dtsx
file—also included in the downloadable files for this chapter—directly from the filesystem.
Alternatively, you can locate an available SSIS package in your system that you want to execute instead. Identify whether this package is stored in the filesystem, or in the SSIS package store.
How to do it...
Let's explore the code required to execute an SSIS package programmatically using PowerShell.
Open the PowerShell console by going to Start | Accessories | Windows PowerShell | Windows PowerShell ISE.
Add the
ManagedDTS
assembly as follows:#add ManagedDTS assembly Add-Type -AssemblyName "Microsoft.SqlServer.ManagedDTS, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
Add the following script and...