11[CmdletBinding (PositionalBinding = $false )]
22Param (
33 [string ][Alias (' c' )]$configuration = " Debug" ,
4+ [string ]$platform = $null ,
45 [string ] $projects ,
56 [string ][Alias (' v' )]$verbosity = " minimal" ,
67 [string ] $msbuildEngine = $null ,
2930function Print-Usage () {
3031 Write-Host " Common settings:"
3132 Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
33+ Write-Host " -platform <value> Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
3234 Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
3335 Write-Host " -binaryLog Output binary log (short: -bl)"
3436 Write-Host " -help Print help and exit"
@@ -77,6 +79,7 @@ function Build {
7779 InitializeCustomToolset
7880
7981 $bl = if ($binaryLog ) { " /bl:" + (Join-Path $LogDir " Build.binlog" ) } else { " " }
82+ $platformArg = if ($platform ) { " /p:Platform=$platform " } else { " " }
8083
8184 if ($projects ) {
8285 # Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons.
@@ -88,6 +91,7 @@ function Build {
8891
8992 MSBuild $toolsetBuildProj `
9093 $bl `
94+ $platformArg `
9195 / p:Configuration= $configuration `
9296 / p:RepoRoot= $RepoRoot `
9397 / p:Restore= $restore `
@@ -129,9 +133,8 @@ try {
129133 Build
130134}
131135catch {
132- Write-Host $_
133- Write-Host $_.Exception
134136 Write-Host $_.ScriptStackTrace
137+ Write-PipelineTelemetryError - Category " InitializeToolset" - Message $_
135138 ExitWithExitCode 1
136139}
137140
0 commit comments