Closed nikhilagrawaldotnet closed 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
test.ps1
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?
Sorted. https://stackoverflow.com/questions/11990688/powershell-is-removing-comma-from-program-argument
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.
and the Powershell
test.ps1
isAnd the output is
where as the expected output was
Is this a bug?