How to use SSISDeploy command in powershell script

Viewed 70

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?

1 Answers
$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
Related