Skip to content

Instantly share code, notes, and snippets.

@SQLvariant
Last active December 17, 2020 10:57
Show Gist options
  • Save SQLvariant/11ef68532b14d2a86db2b265cca47492 to your computer and use it in GitHub Desktop.
Save SQLvariant/11ef68532b14d2a86db2b265cca47492 to your computer and use it in GitHub Desktop.

Revisions

  1. SQLvariant revised this gist May 1, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion DeploySSIS_ISPac.ps1
    Original file line number Diff line number Diff line change
    @@ -19,5 +19,5 @@ $SSISFolder.DeployProject($ProjectName, $projectFile)
    dir "$($ProviderCatalog.PSPath)\Folders\$TargetFolderName\Projects\$ProjectName\Packages" |
    SELECT Name, DisplayName, PackageId

    <# Might as well Exec'ed if ya got 'em! #>
    <# Might as well Exec'em if ya got 'em! #>
    (Get-Item "$($ProviderCatalog.PSPath)\Folders\$TargetFolderName\Projects\$ProjectName\Packages\ReportAndSucceed%2Edtsx").execute($false, $null)
  2. SQLvariant created this gist May 1, 2019.
    23 changes: 23 additions & 0 deletions DeploySSIS_ISPac.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    # 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'ed if ya got 'em! #>
    (Get-Item "$($ProviderCatalog.PSPath)\Folders\$TargetFolderName\Projects\$ProjectName\Packages\ReportAndSucceed%2Edtsx").execute($false, $null)