SSIS and PowerShell in SQL Server 2012

Published Mar 25 2019 03:25 PM 1,847 Views
Not applicable
First published on MSDN on Nov 17, 2011

This post is from Parth Shah, a Software Development Engineer in Test on the SSIS Team.

Previously we have talked about SSIS Catalog Managed Object Model . For those of you don’t remember what MOM is or have not heard of it before, think about MOM as a set of APIs that allow you to automate configuring, deploying, validating and executing your projects and packages in a seamless way. We showed an example of how to achieve this through C# but did you know you can achieve the same result through Windows PowerShell?

This post focuses on the usage of the SSIS Catalog Managed Object Model through Windows PowerShell. Over the course of this blog entry, we will go over a couple scenarios, so you can see how to achieve different tasks using PowerShell. For each scenario, we will go over a goal of what we are trying to achieve and then a simple plan of how we are going to achieve it. And finally, we will present the code that does the actual job.

Scenario #1 – Setting up Integration Services Server to execute a package

Plan:

  1. Establish a connection to the server.
  2. Retrieve the Integration Services object.
  3. Create all objects needed to deploy our project.
  4. Deploy project and then execute our package.
# Load the IntegrationServices Assembly
$loadStatus = [Reflection.Assembly]::Load("Microsoft"+
".SqlServer.Management.IntegrationServices" +
", Version=11.0.0.0, Culture=neutral" +
", PublicKeyToken=89845dcd8080cc91")

# Store the IntegrationServices Assembly namespace to avoid typing it every time
$ISNamespace = "Microsoft.SqlServer.Management.IntegrationServices"

Write-Host "Connecting to server ..."

# Create a connection to the server
$constr = "Data Source=localhost;Initial Catalog=master;Integrated Security=SSPI;"

$con = New-Object System.Data.SqlClient.SqlConnection $constr

# Create the Integration Services object
$ssis = New-Object $ISNamespace".IntegrationServices" $con

## Drop the existing catalog if it exists
# Write-Host "Removing previous catalog ..."
# if ($ssis.Catalogs.Count -gt 0)
# {
# $ssis.Catalogs["SSISDB"].Drop()
# }

# Provision a new SSIS Catalog
Write-Host "Creating new SSISDB Catalog ..."
$cat = New-Object $ISNamespace".Catalog" ($ssis, "SSISDB", "#PASSWORD1")
$cat.Create()

# Create a new folder
Write-Host "Creating Folder ..."
$folder = New-Object $ISNamespace".CatalogFolder" ($cat, "Folder", "Description")
$folder.Create()

# Read the project file, and deploy it to the folder
Write-Host "Deploying ExecutionDemo project ..."
[byte[]] $projectFile = [System.IO.File]::ReadAllBytes("C:\Demos\Demo.ispac")
$folder.DeployProject("ExecutionDemo", $projectFile)

# Run the package
Write-Host "Running package ..."

# When executing, we need to specify two parameters
# 1 arg is a bool representing whether we want to run
# 32bit runtime on 64 bit server
# 2 arg is a reference to an environment if this package depends on it
$executionId = $package.Execute("false", $null)

Write-Host "Package Execution ID: " $executionId


Scenario #2 – Executing complex packages with parameters



Goal: To run a complex package that has parameters that need to filled in



Plan:




  1. Repeat everything from previous scenario up to deploying project


  2. Fill in the values for parameters by either specifying constants or creating environments



# Load the IntegrationServices Assembly
$loadStatus = [Reflection.Assembly]::Load("Microsoft"+
".SqlServer.Management.IntegrationServices" +
", Version=11.0.0.0, Culture=neutral" +
", PublicKeyToken=89845dcd8080cc91")

# Store the IntegrationServices Assembly namespace to avoid typing it every time
$ISNamespace = "Microsoft.SqlServer.Management.IntegrationServices"

Write-Host "Connecting to server ..."

# Create a connection to the server
$constr = "Data Source=localhost;Initial Catalog=master;Integrated Security=SSPI;"

$con = New-Object System.Data.SqlClient.SqlConnection $constr

# Create the Integration Services object
$ssis = New-Object $ISNamespace".IntegrationServices" $con

## Drop the existing catalog if it exists
# Write-Host "Removing previous catalog ..."
# if ($ssis.Catalogs.Count -gt 0)
# {
# $ssis.Catalogs["SSISDB"].Drop()
# }

# Provision a new SSIS Catalog
Write-Host "Creating new SSISDB Catalog ..."
$cat = New-Object $ISNamespace".Catalog" ($ssis, "SSISDB", "#PASSWORD1")
$cat.Create()

# Create a new folder
Write-Host "Creating Folder ..."
$folder = New-Object $ISNamespace".CatalogFolder" ($cat, "Folder", "Description")
$folder.Create()

# Read the project file, and deploy it to the folder
Write-Host "Deploying ExecutionDemo project ..."
[byte[]] $projectFile = [System.IO.File]::ReadAllBytes("C:\Demos\Demo.ispac")
$folder.DeployProject("ExecutionDemo", $projectFile)

#### NEW STUFF STARTS FROM HERE ####

# we can specify the value of parameters to be either constants or
# to take the value from environment variables

$package = $project.Packages[“ComplexPackage.dtsx”]

# setting value of parameter to constant
$package.Parameters["Servername"].Set(
[Microsoft.SqlServer.Management.IntegrationServices.ParameterInfo+ParameterValueType]::Literal,
"Foobar");
$package.Alter()

# binding value of parameter to value of an env variable is a little more complex
# 1) create environment
# 2) add variable to environment
# 3) make project refer to this environment
# 4) make package parameter refer to this environment variable
# These steps are shown below

# 1) creating an environment
$environment = New-Object $ISNamespace".EnvironmentInfo" ($folder, “Env1”, “Env1 Desc.”)
$environment.Create()

# 2) adding variable to our environment
# Constructor args: variable name, type, default value, sensitivity, description
$environment.Variables.Add(“Variable1”, [System.TypeCode]::Int32, “10”, “false”, “Desc.”)
$environment.Alter()

# 3) making project refer to this environment
$project = $folder.Projects[$SSISProjectName]
$project.References.Add($SSISEnv, $folder.Name)
$project.Alter()

# 4) making package parameter refer to this environment variable
$package.Parameters["CoolParam"].Set(
[Microsoft.SqlServer.Management.IntegrationServices.ParameterInfo+ParameterValueType]::Referenced,
$SSISEnvVar)
$package.Alter()

# retrieving environment reference
$environmentReference = $project.References.Item($SSISEnv, $folder.Name)
$environmentReference.Refresh()

# executing with environment reference – Note: if you don’t have any env reference,
# then you specify null as the second argument
$package.Execute("false", $environmentReference)

Write-Host "Package Execution ID: " $executionId
%3CLINGO-SUB%20id%3D%22lingo-sub-388015%22%20slang%3D%22en-US%22%3ESSIS%20and%20PowerShell%20in%20SQL%20Server%202012%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-388015%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Nov%2017%2C%202011%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3E%3CEM%3E%20This%20post%20is%20from%20Parth%20Shah%2C%20a%20Software%20Development%20Engineer%20in%20Test%20on%20the%20SSIS%20Team.%20%3C%2FEM%3E%3C%2FP%3E%0A%20%20%3CP%3EPreviously%20we%20have%20talked%20about%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fmattm%2Farchive%2F2011%2F07%2F26%2Foverview-of-the-ssis-mom.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESSIS%20Catalog%20Managed%20Object%20Model%20%3C%2FA%3E.%20For%20those%20of%20you%20don%E2%80%99t%20remember%20what%20MOM%20is%20or%20have%20not%20heard%20of%20it%20before%2C%20think%20about%20MOM%20as%20a%20set%20of%20APIs%20that%20allow%20you%20to%20automate%20configuring%2C%20deploying%2C%20validating%20and%20executing%20your%20projects%20and%20packages%20in%20a%20seamless%20way.%20We%20showed%20an%20example%20of%20how%20to%20achieve%20this%20through%20C%23%20but%20did%20you%20know%20you%20can%20achieve%20the%20same%20result%20through%20Windows%20PowerShell%3F%3C%2FP%3E%0A%20%20%3CP%3EThis%20post%20focuses%20on%20the%20usage%20of%20the%20SSIS%20Catalog%20Managed%20Object%20Model%20through%20Windows%20PowerShell.%20Over%20the%20course%20of%20this%20blog%20entry%2C%20we%20will%20go%20over%20a%20couple%20scenarios%2C%20so%20you%20can%20see%20how%20to%20achieve%20different%20tasks%20using%20PowerShell.%20For%20each%20scenario%2C%20we%20will%20go%20over%20a%20goal%20of%20what%20we%20are%20trying%20to%20achieve%20and%20then%20a%20simple%20plan%20of%20how%20we%20are%20going%20to%20achieve%20it.%20And%20finally%2C%20we%20will%20present%20the%20code%20that%20does%20the%20actual%20job.%3C%2FP%3E%0A%20%20%3CH3%20id%3D%22toc-hId-1565570108%22%20id%3D%22toc-hId-1598811099%22%3EScenario%20%231%20%E2%80%93%20Setting%20up%20Integration%20Services%20Server%20to%20execute%20a%20package%3C%2FH3%3E%0A%20%20%3CP%3E%3CSTRONG%3E%20Plan%3A%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%20%20%3COL%3E%0A%20%20%20%3CLI%3EEstablish%20a%20connection%20to%20the%20server.%3C%2FLI%3E%0A%20%20%20%3CLI%3ERetrieve%20the%20Integration%20Services%20object.%3C%2FLI%3E%0A%20%20%20%3CLI%3ECreate%20all%20objects%20needed%20to%20deploy%20our%20project.%3C%2FLI%3E%0A%20%20%20%3CLI%3EDeploy%20project%20and%20then%20execute%20our%20package.%3C%2FLI%3E%0A%20%20%3C%2FOL%3E%23%20Load%20the%20IntegrationServices%20Assembly%20%3CBR%20%2F%3E%24loadStatus%20%3D%20%5BReflection.Assembly%5D%3A%3ALoad(%22Microsoft%22%2B%20%3CBR%20%2F%3E%22.SqlServer.Management.IntegrationServices%22%20%2B%20%3CBR%20%2F%3E%22%2C%20Version%3D11.0.0.0%2C%20Culture%3Dneutral%22%20%2B%20%3CBR%20%2F%3E%22%2C%20PublicKeyToken%3D89845dcd8080cc91%22)%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Store%20the%20IntegrationServices%20Assembly%20namespace%20to%20avoid%20typing%20it%20every%20time%20%3CBR%20%2F%3E%24ISNamespace%20%3D%20%22Microsoft.SqlServer.Management.IntegrationServices%22%20%3CBR%20%2F%3E%3CBR%20%2F%3EWrite-Host%20%22Connecting%20to%20server%20...%22%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Create%20a%20connection%20to%20the%20server%20%3CBR%20%2F%3E%24constr%20%3D%20%22Data%20Source%3Dlocalhost%3BInitial%20Catalog%3Dmaster%3BIntegrated%20Security%3DSSPI%3B%22%20%3CBR%20%2F%3E%3CBR%20%2F%3E%24con%20%3D%20New-Object%20System.Data.SqlClient.SqlConnection%20%24constr%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Create%20the%20Integration%20Services%20object%20%3CBR%20%2F%3E%24ssis%20%3D%20New-Object%20%24ISNamespace%22.IntegrationServices%22%20%24con%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%23%20Drop%20the%20existing%20catalog%20if%20it%20exists%20%3CBR%20%2F%3E%23%20Write-Host%20%22Removing%20previous%20catalog%20...%22%20%3CBR%20%2F%3E%23%20if%20(%24ssis.Catalogs.Count%20-gt%200)%20%3CBR%20%2F%3E%23%20%7B%20%3CBR%20%2F%3E%23%20%24ssis.Catalogs%5B%22SSISDB%22%5D.Drop()%20%3CBR%20%2F%3E%23%20%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Provision%20a%20new%20SSIS%20Catalog%20%3CBR%20%2F%3EWrite-Host%20%22Creating%20new%20SSISDB%20Catalog%20...%22%20%3CBR%20%2F%3E%24cat%20%3D%20New-Object%20%24ISNamespace%22.Catalog%22%20(%24ssis%2C%20%22SSISDB%22%2C%20%22%23PASSWORD1%22)%20%3CBR%20%2F%3E%24cat.Create()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Create%20a%20new%20folder%20%3CBR%20%2F%3EWrite-Host%20%22Creating%20Folder%20...%22%20%3CBR%20%2F%3E%24folder%20%3D%20New-Object%20%24ISNamespace%22.CatalogFolder%22%20(%24cat%2C%20%22Folder%22%2C%20%22Description%22)%20%3CBR%20%2F%3E%24folder.Create()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Read%20the%20project%20file%2C%20and%20deploy%20it%20to%20the%20folder%20%3CBR%20%2F%3EWrite-Host%20%22Deploying%20ExecutionDemo%20project%20...%22%20%3CBR%20%2F%3E%5Bbyte%5B%5D%5D%20%24projectFile%20%3D%20%5BSystem.IO.File%5D%3A%3AReadAllBytes(%22C%3A%5CDemos%5CDemo.ispac%22)%20%3CBR%20%2F%3E%24folder.DeployProject(%22ExecutionDemo%22%2C%20%24projectFile)%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Run%20the%20package%20%3CBR%20%2F%3EWrite-Host%20%22Running%20package%20...%22%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20When%20executing%2C%20we%20need%20to%20specify%20two%20parameters%20%3CBR%20%2F%3E%23%201%20arg%20is%20a%20bool%20representing%20whether%20we%20want%20to%20run%20%3CBR%20%2F%3E%23%2032bit%20runtime%20on%2064%20bit%20server%20%3CBR%20%2F%3E%23%202%20arg%20is%20a%20reference%20to%20an%20environment%20if%20this%20package%20depends%20on%20it%20%3CBR%20%2F%3E%24executionId%20%3D%20%24package.Execute(%22false%22%2C%20%24null)%20%3CBR%20%2F%3E%3CBR%20%2F%3EWrite-Host%20%22Package%20Execution%20ID%3A%20%22%20%24executionId%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CH3%20id%3D%22toc-hId--986586853%22%20id%3D%22toc-hId--953345862%22%3EScenario%20%232%20%E2%80%93%20Executing%20complex%20packages%20with%20parameters%3C%2FH3%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3EGoal%3A%20%3C%2FSTRONG%3ETo%20run%20a%20complex%20package%20that%20has%20parameters%20that%20need%20to%20filled%20in%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3E%20Plan%3A%20%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3COL%3E%3CBR%20%2F%3E%3CLI%3ERepeat%20everything%20from%20previous%20scenario%20up%20to%20deploying%20project%3C%2FLI%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CLI%3EFill%20in%20the%20values%20for%20parameters%20by%20either%20specifying%20constants%20or%20creating%20environments%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%23%20Load%20the%20IntegrationServices%20Assembly%20%3CBR%20%2F%3E%24loadStatus%20%3D%20%5BReflection.Assembly%5D%3A%3ALoad(%22Microsoft%22%2B%20%3CBR%20%2F%3E%22.SqlServer.Management.IntegrationServices%22%20%2B%20%3CBR%20%2F%3E%22%2C%20Version%3D11.0.0.0%2C%20Culture%3Dneutral%22%20%2B%20%3CBR%20%2F%3E%22%2C%20PublicKeyToken%3D89845dcd8080cc91%22)%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Store%20the%20IntegrationServices%20Assembly%20namespace%20to%20avoid%20typing%20it%20every%20time%20%3CBR%20%2F%3E%24ISNamespace%20%3D%20%22Microsoft.SqlServer.Management.IntegrationServices%22%20%3CBR%20%2F%3E%3CBR%20%2F%3EWrite-Host%20%22Connecting%20to%20server%20...%22%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Create%20a%20connection%20to%20the%20server%20%3CBR%20%2F%3E%24constr%20%3D%20%22Data%20Source%3Dlocalhost%3BInitial%20Catalog%3Dmaster%3BIntegrated%20Security%3DSSPI%3B%22%20%3CBR%20%2F%3E%3CBR%20%2F%3E%24con%20%3D%20New-Object%20System.Data.SqlClient.SqlConnection%20%24constr%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Create%20the%20Integration%20Services%20object%20%3CBR%20%2F%3E%24ssis%20%3D%20New-Object%20%24ISNamespace%22.IntegrationServices%22%20%24con%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%23%20Drop%20the%20existing%20catalog%20if%20it%20exists%20%3CBR%20%2F%3E%23%20Write-Host%20%22Removing%20previous%20catalog%20...%22%20%3CBR%20%2F%3E%23%20if%20(%24ssis.Catalogs.Count%20-gt%200)%20%3CBR%20%2F%3E%23%20%7B%20%3CBR%20%2F%3E%23%20%24ssis.Catalogs%5B%22SSISDB%22%5D.Drop()%20%3CBR%20%2F%3E%23%20%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Provision%20a%20new%20SSIS%20Catalog%20%3CBR%20%2F%3EWrite-Host%20%22Creating%20new%20SSISDB%20Catalog%20...%22%20%3CBR%20%2F%3E%24cat%20%3D%20New-Object%20%24ISNamespace%22.Catalog%22%20(%24ssis%2C%20%22SSISDB%22%2C%20%22%23PASSWORD1%22)%20%3CBR%20%2F%3E%24cat.Create()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Create%20a%20new%20folder%20%3CBR%20%2F%3EWrite-Host%20%22Creating%20Folder%20...%22%20%3CBR%20%2F%3E%24folder%20%3D%20New-Object%20%24ISNamespace%22.CatalogFolder%22%20(%24cat%2C%20%22Folder%22%2C%20%22Description%22)%20%3CBR%20%2F%3E%24folder.Create()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20Read%20the%20project%20file%2C%20and%20deploy%20it%20to%20the%20folder%20%3CBR%20%2F%3EWrite-Host%20%22Deploying%20ExecutionDemo%20project%20...%22%20%3CBR%20%2F%3E%5Bbyte%5B%5D%5D%20%24projectFile%20%3D%20%5BSystem.IO.File%5D%3A%3AReadAllBytes(%22C%3A%5CDemos%5CDemo.ispac%22)%20%3CBR%20%2F%3E%24folder.DeployProject(%22ExecutionDemo%22%2C%20%24projectFile)%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%23%23%23%20NEW%20STUFF%20STARTS%20FROM%20HERE%20%23%23%23%23%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20we%20can%20specify%20the%20value%20of%20parameters%20to%20be%20either%20constants%20or%20%3CBR%20%2F%3E%23%20to%20take%20the%20value%20from%20environment%20variables%20%3CBR%20%2F%3E%3CBR%20%2F%3E%24package%20%3D%20%24project.Packages%5B%E2%80%9CComplexPackage.dtsx%E2%80%9D%5D%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20setting%20value%20of%20parameter%20to%20constant%20%3CBR%20%2F%3E%24package.Parameters%5B%22Servername%22%5D.Set(%20%3CBR%20%2F%3E%5BMicrosoft.SqlServer.Management.IntegrationServices.ParameterInfo%2BParameterValueType%5D%3A%3ALiteral%2C%20%3CBR%20%2F%3E%22Foobar%22)%3B%20%3CBR%20%2F%3E%24package.Alter()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20binding%20value%20of%20parameter%20to%20value%20of%20an%20env%20variable%20is%20a%20little%20more%20complex%20%3CBR%20%2F%3E%23%201)%20create%20environment%20%3CBR%20%2F%3E%23%202)%20add%20variable%20to%20environment%20%3CBR%20%2F%3E%23%203)%20make%20project%20refer%20to%20this%20environment%20%3CBR%20%2F%3E%23%204)%20make%20package%20parameter%20refer%20to%20this%20environment%20variable%20%3CBR%20%2F%3E%23%20These%20steps%20are%20shown%20below%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%201)%20creating%20an%20environment%20%3CBR%20%2F%3E%24environment%20%3D%20New-Object%20%24ISNamespace%22.EnvironmentInfo%22%20(%24folder%2C%20%E2%80%9CEnv1%E2%80%9D%2C%20%E2%80%9CEnv1%20Desc.%E2%80%9D)%20%3CBR%20%2F%3E%24environment.Create()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%202)%20adding%20variable%20to%20our%20environment%20%3CBR%20%2F%3E%23%20Constructor%20args%3A%20variable%20name%2C%20type%2C%20default%20value%2C%20sensitivity%2C%20description%20%3CBR%20%2F%3E%24environment.Variables.Add(%E2%80%9CVariable1%E2%80%9D%2C%20%5BSystem.TypeCode%5D%3A%3AInt32%2C%20%E2%80%9C10%E2%80%9D%2C%20%E2%80%9Cfalse%E2%80%9D%2C%20%E2%80%9CDesc.%E2%80%9D)%20%3CBR%20%2F%3E%24environment.Alter()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%203)%20making%20project%20refer%20to%20this%20environment%20%3CBR%20%2F%3E%24project%20%3D%20%24folder.Projects%5B%24SSISProjectName%5D%20%3CBR%20%2F%3E%24project.References.Add(%24SSISEnv%2C%20%24folder.Name)%20%3CBR%20%2F%3E%24project.Alter()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%204)%20making%20package%20parameter%20refer%20to%20this%20environment%20variable%20%3CBR%20%2F%3E%24package.Parameters%5B%22CoolParam%22%5D.Set(%20%3CBR%20%2F%3E%5BMicrosoft.SqlServer.Management.IntegrationServices.ParameterInfo%2BParameterValueType%5D%3A%3AReferenced%2C%20%3CBR%20%2F%3E%24SSISEnvVar)%20%3CBR%20%2F%3E%24package.Alter()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20retrieving%20environment%20reference%20%3CBR%20%2F%3E%24environmentReference%20%3D%20%24project.References.Item(%24SSISEnv%2C%20%24folder.Name)%20%3CBR%20%2F%3E%24environmentReference.Refresh()%20%3CBR%20%2F%3E%3CBR%20%2F%3E%23%20executing%20with%20environment%20reference%20%E2%80%93%20Note%3A%20if%20you%20don%E2%80%99t%20have%20any%20env%20reference%2C%20%3CBR%20%2F%3E%23%20then%20you%20specify%20null%20as%20the%20second%20argument%20%3CBR%20%2F%3E%24package.Execute(%22false%22%2C%20%24environmentReference)%20%3CBR%20%2F%3E%3CBR%20%2F%3EWrite-Host%20%22Package%20Execution%20ID%3A%20%22%20%24executionId%20%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-388015%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Nov%2017%2C%202011%20This%20post%20is%20from%20Parth%20Shah%2C%20a%20Software%20Development%20Engineer%20in%20Test%20on%20the%20SSIS%20Team.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-388015%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Edenali%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Mar 25 2019 03:25 PM
Updated by: