Skip to content

Instantly share code, notes, and snippets.

@SQLvariant
Last active December 17, 2020 10:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SQLvariant/11ef68532b14d2a86db2b265cca47492 to your computer and use it in GitHub Desktop.
Save SQLvariant/11ef68532b14d2a86db2b265cca47492 to your computer and use it in GitHub Desktop.
Deploy an .ISPAC file to a SSISDB Catalog using the SSIS Provider
# Variables
$TargetFolderName = "ProviderSolution"
$ProjectFilePath = "C:\temp\SSIS\TestSSISSolution\TestSSISProject\bin\Development\TestSSISProject.ispac"
$ProjectName = "TestSSISProject"
# Get the Integration Services catalog
$ProviderCatalog = Get-Item SQLSERVER:\SSIS\localhost\SQL2017\Catalogs\SSISDB\
# Create the target folder
New-Object "Microsoft.SqlServer.Management.IntegrationServices.CatalogFolder" ($ProviderCatalog,
$TargetFolderName,"Folder description") -OutVariable SSISFolder
$SSISFolder.Create()
# Read the project file and deploy it
[byte[]] $projectFile = [System.IO.File]::ReadAllBytes($ProjectFilePath)
$SSISFolder.DeployProject($ProjectName, $projectFile)
<# Now lets verify our work. #>
dir "$($ProviderCatalog.PSPath)\Folders\$TargetFolderName\Projects\$ProjectName\Packages" |
SELECT Name, DisplayName, PackageId
<# Might as well Exec'em if ya got 'em! #>
(Get-Item "$($ProviderCatalog.PSPath)\Folders\$TargetFolderName\Projects\$ProjectName\Packages\ReportAndSucceed%2Edtsx").execute($false, $null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment