Index: pom.xml =================================================================== --- pom.xml (revision 40769) +++ pom.xml (working copy) @@ -1,9 +1,9 @@ 4.0.0 - org.jvnet.hudson.plugins + org.jenkins-ci.plugins plugin - 1.318 + 1.450 ../pom.xml Index: src/main/java/hudson/plugins/powershell/PowerShell.java =================================================================== --- src/main/java/hudson/plugins/powershell/PowerShell.java (revision 40769) +++ src/main/java/hudson/plugins/powershell/PowerShell.java (working copy) @@ -10,7 +10,7 @@ /** * Invokes Windows power shell from Hudson. - * + * * @author Kohsuke Kawaguchi */ public class PowerShell extends CommandInterpreter { @@ -23,8 +23,8 @@ return ".ps1"; } - protected String[] buildCommandLine(FilePath script) { - return new String[] { "powershell.exe","& \'"+script.getRemote()+"\'"}; + public String[] buildCommandLine(FilePath script) { + return new String[] { "powershell.exe","-ExecutionPolicy", "ByPass", "-Command", "try { . \'"+script.getRemote()+"\' } catch { echo $error; exit 1 }"}; } protected String getContents() {