Hi,
We have Octopus 2.0 and we are trying to automate one of our BI source project. One of the step is to run the source workflow file, here is the working command in PowerShell:
$t = '"D:\Test\UsageTracking.iqp" /wf "Default Workflow" /e "Dev"'
Invoke-Command -ComputerName $DBServer -ScriptBlock {
param ([string] $t1 = $t)
$status = Start-Process "C:\Program Files\iQ4bis\HaloSource\HaloSource.Run.exe" $t1 -Wait -PassThru
$test2 = $status.ExitCode
if ($test2 -ne 0)
{
Throw "The command exited with error code: $test2"
}
else
{
Write-host "Workflow executed successfully."
}
} -ArgumentList $t
My issue is, when I am trying to put this whole value:
‘“D:\Test\UsageTracking.iqp” /wf “Default Workflow” /e “Dev”’
in a Octopus Variable like the one attached in the screenshot attachment,it fails with following error message:
20:38:35Info
‘“D:\Test\UsageTracking.iqp” /wf “Default Workflow” /e “Dev”’
20:38:38Error
The command exited with error code: 3
20:38:38Error
At D:\Octopus\Work\20160401003832-1041\Script.ps1:4 char:1
20:38:38Error
- Invoke-Command -ComputerName $DBServer -ScriptBlock {
20:38:38Error -
20:38:38Error
+ CategoryInfo : OperationStopped: (The command exited with error code: 3:String) [], RuntimeException
20:38:38Error
+ FullyQualifiedErrorId : The command exited with error code: 3
20:38:38Error
20:38:38Fatal
The remote script failed with exit code 1
***Note: I have also attached our PowerShell step as an attachment