Thank you, @Michael Taylor . Your explanation pointed me in the right direction.
I found an article here which gave me the syntax of how to do this:
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I am using the following syntax to launch an SSIS package from PowerShell:
Invoke-Sqlcmd | Out-Null
Set-Location SQLSERVER:\SQL
(Get-ChildItem 'SQLSERVER:\SSIS\{server running SSIS}\Default\Catalogs\SSISDB\Folders\SSIS_Packages\Projects\{Project Foldername}\Packages\' | WHERE { $_.Name -eq 'Package.dtsx' }).Execute("true", $null)
While this syntax is working fine for executing a basic package, I would now like to pass a project parameter of type string from the PowerShell script to the SSIS execution. The string value will be either "test" or "prod"
How would I do that?
Also, please note that our PowerShell scripts are run on a different server than our SSIS instance.
Thank you!
Thank you, @Michael Taylor . Your explanation pointed me in the right direction.
I found an article here which gave me the syntax of how to do this:
The Execute method accepts an optional list of parameter values to use to override what is in the package defaults.
The first optional parameter where you're passing $null is the environment reference. The second optional parameter (that you aren't currently passing) is a collection of parameter values. You can create an instance of the collection, add the parameters you want to set and then pass that collection to the package to override the defaults.
I've not tried to use PS to automate IIS packages with parameters so I'm not 100% sure about the syntax but I suspect you'll have to new up the collection and add the parameters the long way. You could first try passing a hashtable of parameter name/value pairs and see if the cmdlet will auto convert it for you.