@@ -5,69 +5,43 @@ $ErrorActionPreference = 'Stop'
55
66# Implements the AppVeyor 'install' step and installs the required versions of Pester, platyPS and the .Net Core SDK if needed.
77function Invoke-AppVeyorInstall {
8- $requiredPesterVersion = ' 4.3 .1'
8+ $requiredPesterVersion = ' 4.4 .1'
99 $pester = Get-Module Pester - ListAvailable | Where-Object { $_.Version -eq $requiredPesterVersion }
1010 if ($null -eq $pester ) {
1111 if ($null -eq (Get-Module - ListAvailable PowershellGet)) {
1212 # WMF 4 image build
13+ Write-Verbose - Verbose " Installing Pester via nuget"
1314 nuget install Pester - Version $requiredPesterVersion - source https:// www.powershellgallery.com / api/ v2 - outputDirectory " $env: ProgramFiles \WindowsPowerShell\Modules\." - ExcludeVersion
1415 }
1516 else {
1617 # Visual Studio 2017 build (has already Pester v3, therefore a different installation mechanism is needed to make it also use the new version 4)
18+ Write-Verbose - Verbose " Installing Pester via Install-Module"
1719 Install-Module - Name Pester - Force - SkipPublisherCheck - Scope CurrentUser
1820 }
1921 }
2022
2123 if ($null -eq (Get-Module - ListAvailable PowershellGet)) {
2224 # WMF 4 image build
25+ Write-Verbose - Verbose " Installing platyPS via nuget"
2326 nuget install platyPS - Version 0.9 .0 - source https:// www.powershellgallery.com / api/ v2 - outputDirectory " $Env: ProgramFiles \WindowsPowerShell\Modules\." - ExcludeVersion
2427 }
2528 else {
29+ Write-Verbose - Verbose " Installing platyPS via Install-Module"
2630 Install-Module - Name platyPS - Force - Scope CurrentUser - RequiredVersion ' 0.9.0'
2731 }
2832
2933 # the legacy WMF4 image only has the old preview SDKs of dotnet
3034 $globalDotJson = Get-Content (Join-Path $PSScriptRoot ' ..\global.json' ) - Raw | ConvertFrom-Json
3135 $dotNetCoreSDKVersion = $globalDotJson.sdk.version
32- if (-not ((dotnet -- version).StartsWith($dotNetCoreSDKVersion ))) {
36+ # don't try to run this script on linux - we have to do the negative check because IsLinux will be defined in core, but not windows
37+ if (-not ((dotnet -- version).StartsWith($dotNetCoreSDKVersion )) -and ! $IsLinux ) {
3338 [Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12 # https://github.com/dotnet/announcements/issues/77
3439 Invoke-WebRequest ' https://dot.net/v1/dotnet-install.ps1' - OutFile dotnet- install.ps1
3540 .\dotnet- install.ps1 - Version $dotNetCoreSDKVersion
3641 Remove-Item .\dotnet- install.ps1
3742 }
3843}
3944
40- # Implements the AppVeyor 'build_script' step
41- function Invoke-AppVeyorBuild {
42- Param (
43- [Parameter (Mandatory )]
44- [ValidateSet (' FullCLR' , ' NetStandard' )]
45- $BuildType ,
46-
47- [Parameter (Mandatory )]
48- [ValidateSet (' Release' , ' PSv3Release' , ' PSv4Release' )]
49- $BuildConfiguration ,
50-
51- [Parameter (Mandatory )]
52- [ValidateScript ( {Test-Path $_ })]
53- $CheckoutPath
54- )
55-
56- $PSVersionTable
57- Write-Verbose " Pester version: $ ( (Get-Command Invoke-Pester ).Version) " - Verbose
58- Write-Verbose " .NET SDK version: $ ( dotnet -- version) " - Verbose
59- Push-Location $CheckoutPath
60- [Environment ]::SetEnvironmentVariable(" DOTNET_SKIP_FIRST_TIME_EXPERIENCE" , 1 ) # avoid unneccessary initialization in CI
61- if ($BuildType -eq ' FullCLR' ) {
62- .\buildCoreClr.ps1 - Framework net451 - Configuration $BuildConfiguration - Build
63- }
64- elseif ($BuildType -eq ' NetStandard' ) {
65- .\buildCoreClr.ps1 - Framework netstandard2.0 - Configuration Release - Build
66- }
67- .\build.ps1 - BuildDocs
68- Pop-Location
69- }
70-
7145# Implements AppVeyor 'test_script' step
7246function Invoke-AppveyorTest {
7347 Param (
@@ -97,4 +71,4 @@ function Invoke-AppveyorFinish {
9771 # You can add other artifacts here
9872 (Get-ChildItem $zipFile )
9973 ) | ForEach-Object { Push-AppveyorArtifact $_.FullName }
100- }
74+ }
0 commit comments