Skip to content

Commit 122c7d6

Browse files
authored
Merge pull request MicrosoftDocs#10121 from SQLvariant/SSIS-Provider1
Added SSIS PowerShell Provider examples
2 parents 53ffd3c + fa3e469 commit 122c7d6

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

docs/integration-services/ssis-quickstart-deploy-powershell.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,43 @@ You cannot use the information in this quickstart to deploy an SSIS package to S
3131

3232
To deploy the project to Azure SQL Database, get the connection information you need to connect to the SSIS Catalog database (SSISDB). You need the fully qualified server name and login information in the procedures that follow.
3333

34-
1. Log in to the [Azure portal](https://portal.azure.com/).
34+
1. Sign in to the [Azure portal](https://portal.azure.com/).
3535
2. Select **SQL Databases** from the left-hand menu, and then select the SSISDB database on the **SQL databases** page.
3636
3. On the **Overview** page for your database, review the fully qualified server name. To see the **Click to copy** option, hover over the server name.
3737
4. If you forget your Azure SQL Database server login information, navigate to the SQL Database server page to view the server admin name. You can reset the password if necessary.
3838
5. Click **Show database connection strings**.
3939
6. Review the complete **ADO.NET** connection string.
4040

41+
## SSIS PowerShell Provider
42+
Provide appropriate values for the variables at the top of the following script, and then run the script to deploy the SSIS project.
43+
44+
> [!NOTE]
45+
> The following example uses Windows Authentication to deploy to a SQL Server on premises. Use the `New-PSDive` cmdlet to establish a connection using SQL Server authentication. If you're connecting to an Azure SQL Database server, you can't use Windows authentication.
46+
47+
```powershell
48+
# Variables
49+
$TargetInstanceName = "localhost\default"
50+
$TargetFolderName = "Project1Folder"
51+
$ProjectFilePath = "C:\Projects\Integration Services Project1\Integration Services Project1\bin\Development\Integration Services Project1.ispac"
52+
$ProjectName = "Integration Services Project1"
53+
54+
# Get the Integration Services catalog
55+
$catalog = Get-Item SQLSERVER:\SSIS\$TargetInstanceName\Catalogs\SSISDB\
56+
57+
# Create the target folder
58+
New-Object "Microsoft.SqlServer.Management.IntegrationServices.CatalogFolder" ($catalog,
59+
$TargetFolderName,"Folder description") -OutVariable folder
60+
$folder.Create()
61+
62+
# Read the project file and deploy it
63+
[byte[]] $projectFile = [System.IO.File]::ReadAllBytes($ProjectFilePath)
64+
$folder.DeployProject($ProjectName, $projectFile)
65+
66+
# Verify packages were deployed.
67+
dir "$($catalog.PSPath)\Folders\$TargetFolderName\Projects\$ProjectName\Packages" |
68+
SELECT Name, DisplayName, PackageId
69+
```
70+
4171
## PowerShell script
4272
Provide appropriate values for the variables at the top of the following script, and then run the script to deploy the SSIS project.
4373

docs/integration-services/ssis-quickstart-run-powershell.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,23 @@ You cannot use the information in this quickstart to run an SSIS package on Linu
3131

3232
To run the package on Azure SQL Database, get the connection information you need to connect to the SSIS Catalog database (SSISDB). You need the fully qualified server name and login information in the procedures that follow.
3333

34-
1. Log in to the [Azure portal](https://portal.azure.com/).
34+
1. Sign in to the [Azure portal](https://portal.azure.com/).
3535
2. Select **SQL Databases** from the left-hand menu, and then select the SSISDB database on the **SQL databases** page.
3636
3. On the **Overview** page for your database, review the fully qualified server name. To see the **Click to copy** option, hover over the server name.
3737
4. If you forget your Azure SQL Database server login information, navigate to the SQL Database server page to view the server admin name. You can reset the password if necessary.
3838
5. Click **Show database connection strings**.
3939
6. Review the complete **ADO.NET** connection string.
4040

41+
## SSIS PowerShell Provider
42+
You can use the SSIS PowerShell Provider to connect to an SSIS catalog and execute packages within it.
43+
44+
Below is a basic example of how to execute an SSIS package in a package catalog with the SSIS PowerShell Provider.
45+
46+
```powershell
47+
(Get-ChildItem SQLSERVER:\SSIS\localhost\Default\Catalogs\SSISDB\Folders\Project1Folder\Projects\'Integration Services Project1'\Packages\ |
48+
WHERE { $_.Name -eq 'Package.dtsx' }).Execute("false", $null)
49+
```
50+
4151
## PowerShell script
4252
Provide appropriate values for the variables at the top of the following script, and then run the script to run the SSIS package.
4353

0 commit comments

Comments
 (0)