|
3 | 3 | # |
4 | 4 |
|
5 | 5 | #requires -version 5 |
6 | | -[cmdletbinding()] |
| 6 | +[CmdletBinding(PositionalBinding = $false)] |
7 | 7 | param( |
8 | 8 | [string]$Configuration = 'Debug', |
9 | 9 | [string]$BuildNumber = 't000', |
10 | 10 | [string]$PackageVersionPropsUrl = $null, |
11 | 11 | [string]$AccessTokenSuffix = $null, |
12 | 12 | [string]$AssetRootUrl = $null, |
13 | 13 | [string]$RestoreSources = $null, |
14 | | - [switch]$clean |
| 14 | + [switch]$clean, |
| 15 | + [Parameter(ValueFromRemainingArguments = $true)] |
| 16 | + [string[]]$MSBuildArguments |
15 | 17 | ) |
16 | 18 |
|
17 | 19 | $ErrorActionPreference = 'Stop' |
@@ -40,37 +42,35 @@ try { |
40 | 42 | "-p:Configuration=$Configuration" |
41 | 43 | } |
42 | 44 |
|
43 | | - [string[]] $msbuildArgs = @() |
44 | | - |
45 | 45 | if ($AssetRootUrl) { |
46 | | - $msbuildArgs += "-p:DotNetAssetRootUrl=$AssetRootUrl" |
| 46 | + $MSBuildArguments += "-p:DotNetAssetRootUrl=$AssetRootUrl" |
47 | 47 | } |
48 | 48 |
|
49 | 49 | if ($RestoreSources) { |
50 | | - $msbuildArgs += "-p:DotNetAdditionalRestoreSources=$RestoreSources" |
| 50 | + $MSBuildArguments += "-p:DotNetAdditionalRestoreSources=$RestoreSources" |
51 | 51 | } |
52 | 52 |
|
53 | 53 | # PipeBuild parameters |
54 | | - $msbuildArgs += "-p:SignType=${env:PB_SignType}" |
55 | | - $msbuildArgs += "-p:IsFinalBuild=${env:PB_IsFinalBuild}" |
| 54 | + $MSBuildArguments += "-p:SignType=${env:PB_SignType}" |
| 55 | + $MSBuildArguments += "-p:IsFinalBuild=${env:PB_IsFinalBuild}" |
56 | 56 |
|
57 | 57 | if ($clean) { |
58 | | - $msbuildArgs += '-t:Clean' |
| 58 | + $MSBuildArguments += '-t:Clean' |
59 | 59 | } |
60 | 60 |
|
61 | 61 | if ($AccessTokenSuffix) { |
62 | | - $msbuildArgs += "-p:DotNetAccessTokenSuffix=$AccessTokenSuffix" |
| 62 | + $MSBuildArguments += "-p:DotNetAccessTokenSuffix=$AccessTokenSuffix" |
63 | 63 | } |
64 | 64 |
|
65 | 65 | if ($PackageVersionPropsUrl) { |
66 | 66 | $IntermediateDir = Join-Path $PSScriptRoot 'obj' |
67 | 67 | $PropsFilePath = Join-Path $IntermediateDir 'external-dependencies.props' |
68 | 68 | New-Item -ItemType Directory $IntermediateDir -ErrorAction Ignore | Out-Null |
69 | 69 | Get-RemoteFile "${PackageVersionPropsUrl}${AccessTokenSuffix}" $PropsFilePath |
70 | | - $msbuildArgs += "-p:DotNetPackageVersionPropsPath=$PropsFilePath" |
| 70 | + $MSBuildArguments += "-p:DotNetPackageVersionPropsPath=$PropsFilePath" |
71 | 71 | } |
72 | 72 |
|
73 | | - $msbuildArgs += '-t:Build' |
| 73 | + $MSBuildArguments += '-t:Build' |
74 | 74 |
|
75 | 75 | Invoke-Block { & $msbuild ` |
76 | 76 | WindowsInstallers.proj ` |
|
85 | 85 | "-p:Configuration=$Configuration" ` |
86 | 86 | "-p:BuildNumber=$BuildNumber" ` |
87 | 87 | "-bl:$repoRoot/artifacts/logs/installers.msbuild.binlog" ` |
88 | | - @msbuildArgs |
| 88 | + @MSBuildArguments |
89 | 89 | } |
90 | 90 | } |
91 | 91 | finally { |
|
0 commit comments