From 267e246ec62088e06f7e1c16fdf7bfe886f5898f Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 27 Sep 2018 13:37:26 -0700 Subject: [PATCH 1/2] change default of building to include psmodulerestore --- build.psm1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index e8e2f6c9ef46..a0509bad2c82 100644 --- a/build.psm1 +++ b/build.psm1 @@ -406,7 +406,7 @@ function Test-IsPreview } function Start-PSBuild { - [CmdletBinding()] + [CmdletBinding(DefaultParameterSetName="Default")] param( # When specified this switch will stops running dev powershell # to help avoid compilation error, because file are in use. @@ -417,7 +417,10 @@ function Start-PSBuild { [switch]$ResGen, [switch]$TypeGen, [switch]$Clean, + [Parameter(ParameterSetName="Legacy")] [switch]$PSModuleRestore, + [Parameter(ParameterSetName="Default")] + [switch]$NoPSModuleRestore, [switch]$CI, # this switch will re-build only System.Management.Automation.dll @@ -448,6 +451,11 @@ function Start-PSBuild { [string]$ReleaseTag ) + if (!$NoPSModuleRestore) + { + $PSModuleRestore = $true + } + if ($Runtime -eq "linux-arm" -and -not $Environment.IsUbuntu) { throw "Cross compiling for linux-arm is only supported on Ubuntu environment" } From bd1eeb1ecbdb50d030b2749370d4324a1cdd9549 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 1 Oct 2018 14:09:04 -0700 Subject: [PATCH 2/2] address Travis' feedback --- build.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index a0509bad2c82..1fa5615891d7 100644 --- a/build.psm1 +++ b/build.psm1 @@ -451,7 +451,7 @@ function Start-PSBuild { [string]$ReleaseTag ) - if (!$NoPSModuleRestore) + if ($PsCmdlet.ParameterSetName -eq "Default" -and !$NoPSModuleRestore) { $PSModuleRestore = $true }