From 8e0cb11f3bc232862c7a01d870190da1fbe7f736 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 18 Dec 2018 08:40:32 +0000 Subject: [PATCH 1/3] Add WMF to build matrix in AppVeyor --- .appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 4a93cae..b15e91b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,6 +4,8 @@ environment: PSEdition: Core - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 PSEdition: Desktop + - APPVEYOR_BUILD_WORKER_IMAGE: WMF4 + PSEdition: Desktop build_script: - ps: if ( $env:PSEdition -eq 'Desktop' ) { ./tst/test.ps1 -CIBuild } From 9a1caa93fe7c4c635133f3d6bea3e28228fc3825 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 18 Dec 2018 21:07:35 +0000 Subject: [PATCH 2/3] Fix space in name --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index b15e91b..835e14d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,7 +4,7 @@ environment: PSEdition: Core - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 PSEdition: Desktop - - APPVEYOR_BUILD_WORKER_IMAGE: WMF4 + - APPVEYOR_BUILD_WORKER_IMAGE: WMF 4 PSEdition: Desktop build_script: From acc468dc3d548277ff5cd45569a8c852ddc4db1a Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 20 Dec 2018 16:50:03 +0000 Subject: [PATCH 3/3] bootstrap pester for wmf4 differently --- tst/test.ps1 | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tst/test.ps1 b/tst/test.ps1 index 57df0e7..44ddfc1 100644 --- a/tst/test.ps1 +++ b/tst/test.ps1 @@ -12,17 +12,23 @@ try { # makes every test run slow because Get-PackagerProvider # takes 10 seconds if ($CIBuild) { - $minimumNugetProviderVersion = '2.8.5.201' - # not using the -Name parameter because it throws when Nuget is not installed - if (-not (Get-PackageProvider -ListAvailable | Where-Object { $_.Name -eq "Nuget" -and $_.Version -ge $minimumNugetProviderVersion })) { - "Installing Nuget package provider." - Install-PackageProvider -Name NuGet -MinimumVersion $minimumNugetProviderVersion -Force - } - $minimumPesterVersion = "4.4.3" - if (-not (Get-Module -ListAvailable | Where-Object { $_.Name -eq"Pester" -and $_.Version -ge $minimumPesterVersion })) { - "Installing Pester." - Install-Module -Name Pester -Force -MinimumVersion $minimumPesterVersion -Scope CurrentUser + if ($env:AppVeyor -and $null -eq (Get-Module -ListAvailable PowershellGet)) { + # WMF 4 image build + Write-Verbose -Verbose "Installing Pester via nuget" + nuget install Pester -Version $minimumPesterVersion -source https://www.powershellgallery.com/api/v2 -outputDirectory "$env:ProgramFiles\WindowsPowerShell\Modules\." -ExcludeVersion + } + else { + $minimumNugetProviderVersion = '2.8.5.201' + # not using the -Name parameter because it throws when Nuget is not installed + if (-not (Get-PackageProvider -ListAvailable | Where-Object { $_.Name -eq "Nuget" -and $_.Version -ge $minimumNugetProviderVersion })) { + "Installing Nuget package provider." + Install-PackageProvider -Name NuGet -MinimumVersion $minimumNugetProviderVersion -Force + } + if (-not (Get-Module -ListAvailable | Where-Object { $_.Name -eq"Pester" -and $_.Version -ge $minimumPesterVersion })) { + "Installing Pester." + Install-Module -Name Pester -Force -MinimumVersion $minimumPesterVersion -Scope CurrentUser + } } }