Skip to content

Instantly share code, notes, and snippets.

View andreisuslov's full-sized avatar

Andrei Suslov andreisuslov

  • Boston, MA
View GitHub Profile
@creatigent
creatigent / powershell.groovy
Created November 8, 2017 22:59 — forked from MiguelTVMS/powershell.groovy
Groovy script to execute powershell commands on Jenkins
def exec(Map map = [:], command){
def debug = map.debug ?: false
if (debug) echo "[DEBUG] powershell method called with parameter: \n $command"
def returnFileName = new Date().format("yyyyMMddHHmmssSSS")
if (debug) echo "[DEBUG] The return file name will is $returnFileName"
def pwCommand = "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command \"$command\" > $returnFileName"