File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,30 @@ $Arguments = @{
43
43
exclusive = $Exclusive ;
44
44
nuget_useinprocessclient = $true ;
45
45
}.GetEnumerator() | ForEach-Object {
46
- if ($_.value -ne " " ) { " --{0}=`" {1}`" " -f $_.key , $_.value }
46
+ if ($ ($_.Key -ceq " dryrun" ) -or ($_.Key -ceq " exclusive" )) {
47
+ if ($_.Value -eq $true ) {
48
+ # switches must not be assigned true or false, but must be passed to indicate true.
49
+ " --{0}" -f $_.Key
50
+ }
51
+ }
52
+ else {
53
+ if ($_.Value -cne " " ) {
54
+ if ($_.Value -as [string ] -contains " " ) {
55
+ $_.Value = " $ ( $_.Value ) " # if it contains spaces, enclose it.
56
+ }
57
+ " --{0}={1}" -f $_.Key , $_.Value
58
+ }
59
+ }
47
60
};
48
61
62
+ $Arguments | Join-String - Separator " " | Write-Verbose
63
+
49
64
# Start Cake
50
65
Write-Host " Running build stage $Stage ..."
51
66
52
- & dotnet run -- project build/ $Stage / $Stage.csproj -- $Arguments $ScriptArgs
67
+ $cmdline = " & dotnet run --project build/$Stage /$Stage .csproj -- $Arguments $ScriptArgs "
68
+ Write-Verbose $cmdline
69
+ Invoke-Command - ScriptBlock ([scriptblock ]::Create($cmdline ))
53
70
54
71
if ($env: APPVEYOR ) {
55
72
$host.SetShouldExit ($LASTEXITCODE )
You can’t perform that action at this time.
0 commit comments