Files
ChocolateyPackages/Elixir/tools/chocolateyUninstall.ps1
Iristyle aedb2424aa chore: release Elixir 0.12
- fixed issue with bad uninstaller / herestring
2014-01-03 12:52:31 -05:00

29 lines
752 B
PowerShell

$package = 'Elixir'
try {
$location = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root
if (!(Test-Path $location))
{
$location = Join-Path $Env:SystemDrive 'tools'
}
$location = Join-Path $location $package
if (Test-Path $location)
{
Remove-Item $location -Recurse -Force
}
$binLocation = (Join-Path $location 'bin') -replace '\\', '\\'
$userPaths = [Environment]::GetEnvironmentVariable('Path', 'User') -split ';' |
? { ($_ -notmatch $binLocation) -and (![String]::IsNullOrEmpty($_)) } |
Select-Object -Unique
[Environment]::SetEnvironmentVariable('Path', ($userPaths -join ';'), 'User')
Write-ChocolateySuccess $package
} catch {
Write-ChocolateyFailure $package "$($_.Exception.Message)"
throw
}