Skip to content

Commit a012655

Browse files
AdmiringWormgep13
authored andcommitted
(chocolatey#2470) Update helper to deprecate Get-BinRoot
This commit updates the Get-ToolsLocation to mention that the alias Get-BinRoot is deprecated, as well as making the current call to `Write-Host` to instead output a warning that the alias is deprecated.
1 parent 234ad2d commit a012655

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/chocolatey.resources/helpers/functions/Get-ToolsLocation.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ same package directory could get tricky.
3131
3232
.NOTES
3333
This is the successor to the poorly named `Get-BinRoot`. Available as
34-
`Get-ToolsLocation` in 0.9.10+. If you need compatibility with pre
35-
0.9.10, please use `Get-BinRoot`.
34+
`Get-ToolsLocation` in 0.9.10+. The Alias `Get-BinRoot` will be removed
35+
in version 2.0.0.
3636
3737
Sets an environment variable called `ChocolateyToolsLocation`. If the
3838
older `ChocolateyBinRoot` is set, it uses the value from that and
@@ -49,7 +49,7 @@ None
4949
Write-FunctionCallLogMessage -Invocation $invocation -Parameters $PSBoundParameters
5050

5151
if ($invocation -ne $null -and $invocation.InvocationName -ne $null -and $invocation.InvocationName.ToLower() -eq 'get-binroot') {
52-
Write-Host "Get-BinRoot is going to be deprecated in v1 and removed in v2. It has been replaced with Get-ToolsLocation (starting with v0.9.10), however many packages no longer require a special separate directory since package folders no longer have versions on them. Some do though and should continue to use Get-ToolsLocation."
52+
Write-Warning "Get-BinRoot is deprecated in v1 and removed in v2. It has been replaced with Get-ToolsLocation (starting with v0.9.10), however many packages no longer require a special separate directory since package folders no longer have versions on them. Some do though and should continue to use Get-ToolsLocation."
5353
}
5454

5555
$toolsLocation = $env:ChocolateyToolsLocation

0 commit comments

Comments
 (0)