Skip to content

Commit eccf488

Browse files
committed
Align slngen command formatting with GenerateAllSolution.ps1
1 parent 341a9dd commit eccf488

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

GenerateSingleSolution.ps1

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,14 @@ $projects = [System.Collections.ArrayList]::new()
167167
dotnet tool restore
168168

169169
$generatedSolutionFilePath = "$componentPath\$componentName.sln"
170-
$platforms = '"Any CPU;x64;x86;ARM64"'
171-
$slngenConfig = "--folders true --collapsefolders true --ignoreMainProject"
170+
$platforms = 'Any CPU;x64;x86;ARM64'
171+
$slngenConfig = @(
172+
'--folders'
173+
'true'
174+
'--collapsefolders'
175+
'true'
176+
'--ignoreMainProject'
177+
)
172178

173179
# Remove previous file if it exists
174180
if (Test-Path -Path $generatedSolutionFilePath)
@@ -225,11 +231,26 @@ else
225231
$diagnostics = ""
226232
}
227233

228-
$cmd = "dotnet$sdkoptions tool run slngen -o $generatedSolutionFilePath $slngenConfig $diagnostics--platform $platforms $($projects -Join ' ')"
234+
$cmd = 'dotnet'
235+
$arguments = @(
236+
$sdkoptions
237+
'tool'
238+
'run'
239+
'slngen'
240+
'-o'
241+
$generatedSolutionFilePath
242+
$slngenConfig
243+
$diagnostics
244+
'--platform'
245+
$platforms
246+
$projects
247+
"--launch $launch"
248+
)
249+
229250

230-
Write-Output "Running Command: $cmd"
251+
Write-Output "Running Command: $cmd $arguments"
231252

232-
Invoke-Expression $cmd
253+
&$cmd @arguments
233254

234255
# go back to main working directory
235256
Pop-Location

0 commit comments

Comments
 (0)