Saturday, October 26, 2013

Passing Jenkins Build Variables Using PowerShell's "invoke-command" Cmdlet

Sometimes it is the small things that can take up most of the time when I'm working with PowerShell scripts in Jenkins. I call this the PowerShell Pareto Principle! Usually it is a syntax issue that bites me, but recently I had trouble passing in build variables using the invoke-command cmdlet. This example should clear things up if you encounter the same perplexities which stumped me.

invoke-command your_remote_servername {param(

By using the ArgumentList argument of invoke-command you can pass in outside variables into the Jenkins PowerShell plugin, executing code targeted for a remote server running the WinRM service. That's Hot!™


  1. Thank you for this valuable information. It was really helpful.

    IOSH safety course in Kuwait

  2. very nice articles ....use full information...and thanks for sharing....
    IOSH safety course in Kuwait