Closed majkinetor closed 8 years ago
$env:ChocolateyToolsRoot
is set to c:\tools
here so it doesn't help.
I finished by hardcoding bin
part:
$cmdPath = join-path $env:ChocolateyInstall bin\yed.cmd
This is the method used in installer: https://chocolatey.org/install.ps1
Write-Output 'Ensuring chocolatey commands are on the path'
$chocInstallVariableName = "ChocolateyInstall"
$chocoPath = [Environment]::GetEnvironmentVariable($chocInstallVariableName)
if ($chocoPath -eq $null -or $chocoPath -eq '') {
$chocoPath = 'C:\ProgramData\Chocolatey'
}
$chocoExePath = Join-Path $chocoPath 'bin'
$cmdPath = join-path $env:ChocolateyInstall 'bin\yed.cmd'
This is correct - when the path you are looking for is the Chocolatey Install bin folder, it is not the binroot var. You do just as you have done above 👍