Add ToolsRoot so Chocolatey_Bin_Root is \tools
This commit is contained in:
23
ToolsRoot/tools/chocolateyUninstall.ps1
Normal file
23
ToolsRoot/tools/chocolateyUninstall.ps1
Normal file
@@ -0,0 +1,23 @@
|
||||
$package = 'ToolsRoot'
|
||||
|
||||
try
|
||||
{
|
||||
$variableName = 'Chocolatey_Bin_Root'
|
||||
$binRoot = Get-Item Env:$variableName -ErrorAction SilentlyContinue |
|
||||
Select -ExpandProperty Value -First 1
|
||||
|
||||
if ($binRoot)
|
||||
{
|
||||
[Environment]::SetEnvironmentVariable($variableName, '', 'User')
|
||||
Set-Item Env:$variableName $null
|
||||
|
||||
Write-Host "Removed $variableName [was $binRoot]"
|
||||
}
|
||||
|
||||
Write-ChocolateySuccess $package
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||
throw
|
||||
}
|
Reference in New Issue
Block a user