diff --git a/project/core/tasks/PowerShellTask.cs b/project/core/tasks/PowerShellTask.cs old mode 100644 new mode 100755 index 30487bab6..eb8aafdbe --- a/project/core/tasks/PowerShellTask.cs +++ b/project/core/tasks/PowerShellTask.cs @@ -209,6 +209,16 @@ public string SuccessExitCodes [ReflectorProperty("buildTimeoutSeconds", Required = false)] public int BuildTimeoutSeconds { get; set; } + /// + /// CCnet 1.8 always uses -File for execution, this means that if you want to pass an array + /// of strings as an argument it screws it up, I'm adding the ability to use -Command which + /// will behave as the user expects, however this will optional for backwards compatibility + /// + /// 1.8 + /// false + [ReflectorProperty("useCommandExecution", Required = false)] + public bool UseCommandExecution { get; set; } + /// /// Run the specified PowerShell and add its output to the build results. /// @@ -395,7 +405,7 @@ private string Args(IIntegrationResult result) builder.AppendArgument("-NoProfile"); builder.AppendArgument("-NonInteractive"); - builder.AppendArgument("-file"); + builder.AppendArgument(UseCommandExecution ? "-command" : "-file"); if (!string.IsNullOrEmpty(Script)) {