question

arielman2304-0180 avatar image
0 Votes"
arielman2304-0180 asked arielman2304-0180 answered

How to use SSISDeploy command in powershell script


I'm running SSISDeploy command (documentation is here) in my CMD:

 SSISDeploy.exe -s:"download\Integration Services.ispac" -d:catalog;/SSISDB/TEST/DEVOPS;"TEST03,1234" -at:win

all working good, and now I need to run it thought powershell script (against windows server 2019 slave), so I tried this syntax:

 $SSISDeploy = Start-Process -FilePath SSISDeploy.exe -ArgumentList '/source:"download\Integration Services.ispac"',"/destination:catalog;${Target};"${Env}"" -at:win -wait -PassThru -Credential $cred -RedirectStandardOutput ssisstdout.txt -RedirectStandardError ssisstderr.txt

but it fails with exception:

 Start-Process : A positional parameter cannot be found that accepts argument 'TEST03,1234'.
 + ... SISDeploy = Start-Process -FilePath SSISDeploy.exe -ArgumentList '/so ...
 +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : InvalidArgument: (:) [Start-Process], ParameterBindingException
     + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand


Can you suggest what's wrong with the syntax?





windows-server-powershellsql-server-integration-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

arielman2304-0180 avatar image
0 Votes"
arielman2304-0180 answered
 $StartProcessProps = @{
     FilePath               = 'SSISDeploy.exe'
     ArgumentList          = '-s:"download\Integration Services.ispac" -d:catalog;{0};{1} -at:win' -f $Target, $Env
     Wait                   = $true
     PassThru               = $true
     Credential             = $cred
     RedirectStandardOutput = 'ssisstdout.txt'
     RedirectStandardError  = 'ssisstderr.txt'
 }
 $SSISDeploy = Start-Process @StartProcessProp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered arielman2304-0180 edited

Hi,

Please try this.

 Start-Process -FilePath SSISDeploy.exe -ArgumentList "/source:'download\Integration Services.ispac' /destination:catalog;${Target};'${Env}' -at:win" -wait -PassThru -Credential $cred -RedirectStandardOutput ssisstdout.txt -RedirectStandardError ssisstderr.txt

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I tried and got this exception:

  + }
  + ~
  Unexpected token '}' in expression or statement.


0 Votes 0 ·