SharpeRAD / Cake.Powershell

Powershell addin for Cake
http://cakebuild.net
MIT License
83 stars 36 forks source link

Params passed as comma separated are replaced as space separated #63

Closed nikhilagrawaldotnet closed 6 years ago

nikhilagrawaldotnet commented 6 years ago

I wanted to launch a powershell script which takes comma separated values in a string param. On writing the passed value, we found out that the values were replaced with spaces.

#addin "Cake.Powershell"

Task("Default")
.Does(() =>
{
    StartPowershellFile("test.ps1", args => 
    {
        args.Append("foo" , "A,B");
    });
});

var target = Argument("target", "");
RunTarget(target);

and the Powershell test.ps1 is

param([string] $foo)

Write-Host($foo)

And the output is

Executing: &"D:/Dev/Foo/test.ps1" -foo A,B
A B

where as the expected output was

Executing: &"D:/Dev/Foo/test.ps1" -foo A,B
A,B

Is this a bug?

nikhilagrawaldotnet commented 6 years ago

Sorted. https://stackoverflow.com/questions/11990688/powershell-is-removing-comma-from-program-argument