ps/Modules/Alkami.PowerShell.Common/Public/Get-ChocolateyInstallPath.ps1

21 lines
567 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
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
}