Skip to content

Commit

Permalink
Merge pull request chocolatey#1507 from gep13/issue-1401
Browse files Browse the repository at this point in the history
(chocolateyGH-1401) Added initial call to Chocolatey after installation
  • Loading branch information
ferventcoder authored Feb 22, 2018
2 parents 7da6b61 + 35add3b commit 3cb969b
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-Initial
if ($env:ChocolateyExitCode -eq $null -or $env:ChocolateyExitCode -eq '') {
$env:ChocolateyExitCode = 0
}
Expand Down Expand Up @@ -700,4 +701,17 @@ param(
}
}

function Invoke-Chocolatey-Initial {
Write-Debug "Initializing Chocolatey files, etc by 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 3cb969b

Please sign in to comment.