I have a jenkins step defined like this:
script {
def cmd = ' & "' + env.WORKSPACE + '\\SpearsLoad\\Scripts\\DeploySSISPackage.Ps1 -server ' + dbServer + ' -ProjectFilePath ' + env.WORKSPACE + '\\SpearsLoad\\bin\\' + buildConfig + '\\SpearsLoad.ispac"'
println cmd
def msg = powershell(returnStdout: true, script: ' & "' + env.WORKSPACE + '\\SpearsLoad\\Scripts\\DeploySSISPackage.Ps1 -server ' + dbServer + ' -ProjectFilePath ' + env.WORKSPACE + '\\SpearsLoad\\bin\\' + buildConfig + '\\SpearsLoad.ispac"')
println msg
}
at println cmd I get exactly the powershell i want:
c:\workspace\Spears_master\SpearsLoad\Scripts\DeploySSISPackage.Ps1 -server LONSQLLD01\L14D1 -ProjectFilePath c:\workspace\Spears_master\SpearsLoad\bin\development\SpearsLoad.ispac
I tried inserting the expression in the powershell command:
powershell(returnStdout: true, script: ' & "' + env.WORKSPACE + '\\SpearsLoad\\Scripts\\DeploySSISPackage.Ps1 -server ' + dbServer + ' -ProjectFilePath ' + env.WORKSPACE + '\\SpearsLoad\\bin\\' + buildConfig + '\\SpearsLoad.ispac"')
which fails as does using the variable
powershell(returnStdout: true, script: cmd)
In both cases I get: is not recognized as the name of a cmdlet, function, script file, or operable program.
It feels like an escaping problem but I am lost - can anyone point me in the right direction
println msg