[go: nahoru, domu]

Skip to content

Commit

Permalink
Switch out call from Invoke-Expression to direct usage
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-hawker committed Aug 25, 2023
1 parent aca3ba7 commit 384dbef
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions GenerateAllSolution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ Param (

# Set up constant values
$generatedSolutionFilePath = 'CommunityToolkit.AllComponents.sln'
$platforms = '"Any CPU;x64;x86;ARM64"'
$slngenConfig = "--folders true --collapsefolders true --ignoreMainProject"
$platforms = 'Any CPU;x64;x86;ARM64'
$slngenConfig = @(
'--folders'
'true'
'--collapsefolders'
'true'
'--ignoreMainProject'
)

# Remove previous file if it exists
if (Test-Path -Path $generatedSolutionFilePath)
Expand Down Expand Up @@ -69,17 +75,33 @@ if ($IncludeHeads -ne 'uwp')

if ($UseDiagnostics.IsPresent)
{
$sdkoptions = " -d"
$diagnostics = '-bl:slngen.binlog --consolelogger:"ShowEventId;Summary;Verbosity=Detailed" '
$sdkoptions = "-d"
$diagnostics = @(
'-bl:slngen.binlog'
'--consolelogger:"ShowEventId;Summary;Verbosity=Detailed"'
)
}
else
{
$sdkoptions = ""
$diagnostics = ""
}

$cmd = "dotnet$sdkoptions tool run slngen -o $generatedSolutionFilePath $slngenConfig $diagnostics--platform $platforms $($projects -Join ' ')"
$cmd = 'dotnet'
$arguments = @(
$sdkoptions
'tool'
'run'
'slngen'
'-o'
$generatedSolutionFilePath
$slngenConfig
$diagnostics
'--platform'
$platforms
$projects
)

Write-Output "Running Command: $cmd"
Write-Output "Running Command: $cmd $arguments"

Invoke-Expression $cmd
&$cmd @arguments

0 comments on commit 384dbef

Please sign in to comment.