Skip to content

Commit

Permalink
(chocolateyGH-1401) Added initial call to Chocolatey after installation
Browse files Browse the repository at this point in the history
- This ensures that all necessary setup is completed
- Ready for further execution
  • Loading branch information
gep13 committed Feb 22, 2018
1 parent 7da6b61 commit 2a1e9ba
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nuget/chocolatey/tools/chocolateysetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Creating Chocolatey folders if they do not already exist.

Add-ChocolateyProfile
Install-DotNet4IfMissing
Invoke-Chocolatey
if ($env:ChocolateyExitCode -eq $null -or $env:ChocolateyExitCode -eq '') {
$env:ChocolateyExitCode = 0
}
Expand Down Expand Up @@ -700,4 +701,17 @@ param(
}
}

function Invoke-Chocolatey {
Write-Debug "Running Chocolatey..."

try {
$chocoInstallationFolder = Get-ChocolateyInstallFolder
$chocoExe = Join-Path -Path $chocoInstallationFolder -ChildPath "choco.exe"
& $chocoExe | Out-Null
Write-Debug "Chocolatey execution completed successfully."
} catch {
Write-ChocolateyWarning "Unable to run Chocolately at this time. It is likely that .Net Framework installation requires a system reboot"
}
}

Export-ModuleMember -function Initialize-Chocolatey;

0 comments on commit 2a1e9ba

Please sign in to comment.