Downloading an SSIS package to a file
This recipe will download an
SSIS package back to a .dtsx
file.
Getting ready
Locate a package stored in the package store that you want to download to the filesystem. Note the path to this package.
How to do it...
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 run:
$server = "KERRIGAN" #create new app $app = New-Object "Microsoft.SqlServer.Dts.Runtime.Application" $timestamp = Get-Date -format "yyyy-MMM-dd-hhmmtt" $destinationFolder = "C:\SSIS" $packageToDownload = "Customer Package" $packageParentPath = "\File System\QueryWorks" #download the specified package #here we're dealing with a package in #the SSIS Package store $app.GetDtsServerPackageInfos($packageParentPath,$server...