From af81a5174e2c7f780a703d4aca4084f70ef90e11 Mon Sep 17 00:00:00 2001 From: Jianyun Tao Date: Tue, 29 Nov 2016 18:43:24 -0800 Subject: [PATCH] Install the PowerShellCore from appveyor artifacts and Enable OneGet daily run. --- Test/run-tests.ps1 | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Test/run-tests.ps1 b/Test/run-tests.ps1 index 47fa58e10..69300107c 100644 --- a/Test/run-tests.ps1 +++ b/Test/run-tests.ps1 @@ -207,15 +207,27 @@ if ($testframework -eq "coreclr") If($script:IsWindows) { - Install-PackageProvider PSL -Force -verbose - $powershellCore = (Get-Package -provider PSL -name PowerShell -ErrorAction SilentlyContinue) - if ($powershellCore) + if($env:APPVEYOR_SCHEDULED_BUILD -eq 'True') { - Write-Warning ("PowerShell already installed" -f $powershellCore.Name) + # for the daily run, we need to install PowerShellCore from github.com/powershell/powershell appveryor artifacts + + $powershellMSIPackage = Get-PowerShellCoreBuild -Verbose + + Write-Verbose $powershellMSIPackage + $powershellCore = Install-Package $powershellMSIPackage -provider msi -verbose -force } else - { - $powershellCore = Install-Package PowerShell -Provider PSL -Force -verbose + { + Install-PackageProvider PSL -Force -verbose + $powershellCore = (Get-Package -provider PSL -name PowerShell -ErrorAction SilentlyContinue) + if ($powershellCore) + { + Write-Warning ("PowerShell already installed" -f $powershellCore.Name) + } + else + { + $powershellCore = Install-Package PowerShell -Provider PSL -Force -verbose + } } $powershellVersion = $powershellCore.Version