From 346127434922c248dfe0c96f59330e627c786b49 Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Sun, 1 Mar 2015 22:12:08 +0000 Subject: [PATCH] (GH-218) Force installation of latest Chocolatey --- BuildScripts/default.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/BuildScripts/default.ps1 b/BuildScripts/default.ps1 index 61b46941e..3e81c75dd 100644 --- a/BuildScripts/default.ps1 +++ b/BuildScripts/default.ps1 @@ -228,6 +228,14 @@ Task -Name __RemoveBuildArtifactsDirectory -Description $private -Action { Task -Name __InstallChocolatey -Description $private -Action { if(isChocolateyInstalled) { Write-Host "Chocolatey already installed"; + Write-Host "Updating to latest Chocolatey..." + $choco = Join-Path (Join-Path $script:chocolateyDir "chocolateyInstall") -ChildPath "chocolatey.cmd"; + + exec { + Invoke-Expression "$choco update chocolatey"; + } + + Write-Host "Latest Chocolatey installed." } else { try { Write-Host "Chocolatey is not installed, installing Chocolatey..."; @@ -241,11 +249,11 @@ Task -Name __InstallChocolatey -Description $private -Action { throw "Error installing Chocolatey" } - Write-Host ("************ Install PSBuild Successful ************") + Write-Host ("************ Install Chocolatey Successful ************") } catch { Write-Error $_ - Write-Host ("************ Install PSBuild Failed ************") + Write-Host ("************ Install Chocolatey Failed ************") } } } @@ -592,7 +600,7 @@ Task -Name DeployDevelopPackageToMyGet -Description "Takes the packaged Chocolat } } -Task -Name DeployMasterSolutionToMyGet -Description "Takes the packaged Chocolatey package from master branch and deploys to MyGet.org" -Action { +Task -Name DeployMasterPackageToMyGet -Description "Takes the packaged Chocolatey package from master branch and deploys to MyGet.org" -Action { $buildArtifactsDirectory = get-buildArtifactsDirectory; try {