@@ -5,69 +5,43 @@ $ErrorActionPreference = 'Stop'
5
5
6
6
# Implements the AppVeyor 'install' step and installs the required versions of Pester, platyPS and the .Net Core SDK if needed.
7
7
function Invoke-AppVeyorInstall {
8
- $requiredPesterVersion = ' 4.3 .1'
8
+ $requiredPesterVersion = ' 4.4 .1'
9
9
$pester = Get-Module Pester - ListAvailable | Where-Object { $_.Version -eq $requiredPesterVersion }
10
10
if ($null -eq $pester ) {
11
11
if ($null -eq (Get-Module - ListAvailable PowershellGet)) {
12
12
# WMF 4 image build
13
+ Write-Verbose - Verbose " Installing Pester via nuget"
13
14
nuget install Pester - Version $requiredPesterVersion - source https:// www.powershellgallery.com / api/ v2 - outputDirectory " $env: ProgramFiles \WindowsPowerShell\Modules\." - ExcludeVersion
14
15
}
15
16
else {
16
17
# 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"
17
19
Install-Module - Name Pester - Force - SkipPublisherCheck - Scope CurrentUser
18
20
}
19
21
}
20
22
21
23
if ($null -eq (Get-Module - ListAvailable PowershellGet)) {
22
24
# WMF 4 image build
25
+ Write-Verbose - Verbose " Installing platyPS via nuget"
23
26
nuget install platyPS - Version 0.9 .0 - source https:// www.powershellgallery.com / api/ v2 - outputDirectory " $Env: ProgramFiles \WindowsPowerShell\Modules\." - ExcludeVersion
24
27
}
25
28
else {
29
+ Write-Verbose - Verbose " Installing platyPS via Install-Module"
26
30
Install-Module - Name platyPS - Force - Scope CurrentUser - RequiredVersion ' 0.9.0'
27
31
}
28
32
29
33
# the legacy WMF4 image only has the old preview SDKs of dotnet
30
34
$globalDotJson = Get-Content (Join-Path $PSScriptRoot ' ..\global.json' ) - Raw | ConvertFrom-Json
31
35
$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 ) {
33
38
[Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12 # https://github.com/dotnet/announcements/issues/77
34
39
Invoke-WebRequest ' https://dot.net/v1/dotnet-install.ps1' - OutFile dotnet- install.ps1
35
40
.\dotnet- install.ps1 - Version $dotNetCoreSDKVersion
36
41
Remove-Item .\dotnet- install.ps1
37
42
}
38
43
}
39
44
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
-
71
45
# Implements AppVeyor 'test_script' step
72
46
function Invoke-AppveyorTest {
73
47
Param (
@@ -97,4 +71,4 @@ function Invoke-AppveyorFinish {
97
71
# You can add other artifacts here
98
72
(Get-ChildItem $zipFile )
99
73
) | ForEach-Object { Push-AppveyorArtifact $_.FullName }
100
- }
74
+ }
0 commit comments