function Get-ChocolateyInstallPath { <# .SYNOPSIS Get the path to the root of the chocolatey install folder #> [CmdletBinding()] Param() $logLead = (Get-LogLeadName) $envChocolateyInstallValue = $env:ChocolateyInstall if ($null -eq $envChocolateyInstallValue) { $envChocolateyInstallValue = (Join-Path -Path (Join-Path -Path $env:SystemDrive -ChildPath "ProgramData") -ChildPath "chocolatey") } Write-Verbose "$logLead : Found chocolatey install path [$envChocolateyInstallValue]" return $envChocolateyInstallValue }