How to execute PowerShell command/scripts directly from Jenkins 2.0 pipeline groovy script

3,719 views
Skip to first unread message

Yogesh Bhole

unread,
Jun 27, 2016, 4:21:04 AM6/27/16
to Jenkins Users
How to execute PowerShell command/scripts directly from Jenkins 2.0 pipeline groovy script. Right now I am executing it from bat command. Using it I have to think lot about single/double quotes when using paramaters in statement.

bat 'powershell "Stop-Service -Name Windows.* -Verbose"'


It could be nice if there is something like

powershell "Stop-Service -Name Windows.* -Verbose"

-------------------------------------------
Jekins 2.10 on Windows 10

Slide

unread,
Jun 27, 2016, 10:45:11 AM6/27/16
to Jenkins Users

The powershell plugin would need to add support for pipeline. You could file a request in JIRA for it.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b7578d5b-d17e-4749-ae13-565ca7b8d3af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages