cake-build / cake-build/resources
build.ps1: Imposible to pass an argument value with "," ";" symbols
- Dominant language
- PowerShell
- Stars
- 57
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
I have a cake script with Argument publishTargets:
```
var publishTargets = Argument("publishTargets","dev,internal");
```
I need to pass a value like "dev,internal" or "dev,release" and so on into it.
The key point here is "," symbol. With ";" symbol there's the same picture.
What I tried:
#### 1. via `-arg`
```
powershell ./build.ps1 -target Publish -publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true
```
Output:
```
D:\Work\R-n-D\XFW3.git\Build>D:\Work\R-n-D\XFW3.git\Build\build-Publish.cmd
At line:1 char:53
+ ./build.ps1 -target Publish -publishTargets=internal,dev -channel=SNA ...
+ ~
Missing argument in parameter list.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingArgument
```
#### 2. via ScriptArgs
```
powershell ./build.ps1 -target Publish -ScriptArgs '-publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true'
```
Output:
```
Running build script...
Invoke-Expression : At line:1 char:158
+ ... n="Release" -verbosity="Verbose" -publishTargets=internal,dev -cha ...
+ ~
Missing argument in parameter list.
At D:\Work\R-n-D\XFW3.git\Build\build.ps1:188 char:1
+ Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
+ FullyQualifiedErrorId : MissingArgument,Microsoft.PowerShell.Commands.InvokeExpressionCommand
```
#### 3. via `--arg`
```
powershell ./build.ps1 -target Publish --publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true
```
Output:
```
D:\Work\R-n-D\XFW3.git\Build>D:\Work\R-n-D\XFW3.git\Build\build-Publish.cmd
Preparing to run build script...
Running build script...
More than one build script specified.
Usage: Cake.exe [script] [--verbosity=value]
[--showdescription] [--dryrun] [..]
Example: Cake.exe
```
#### 4. Running directly via cake.exe
It works.
```
tools/Cake/cake -target=Publish -publishTargets="internal;dev" -channel=SNAPSHOT -settings_skipverification=true -verbosity=diagnostic
```
### Environment
Cake 0.22.2
OS x64 Windows 10
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.