Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Invoking a powershell command as a variable reference with a parameter list

$
0
0

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?


Viewing all articles
Browse latest Browse all 10624

Trending Articles