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