Skip to content

Commit

Permalink
(GH-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 35add3b
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 35add3b

Please sign in to comment.