I'm trying to embed a powershell script into the jenkins CI tool. The script location is a variable and one of the parameters is a variable. I having been trying all sort of combinations such as:
Invoke-Command {$script infatest_repository1 Domain_NA2INFTESTETL2 zzz_dev_jenkins deploymentOptions-dev2test.xml $jenkinsWORKSPACE }
When I run this version is does not seem to like the script as a variable (i.e. $script)
I have tried:
$command = "C:\temp\myscript.ps1"
$cmadArgs = @('1','2',"$jenkinsWORKSPACE")
& $command $cmdArgs
Can somebody suggest a proper method?