Files
ChocolateyPackages/CasperJS/tools/chocolateyUninstall.ps1
Iristyle e9ef7301a8 feat: CasperJS 1.1-beta1
- builds on top of PhantomJS to ease scripting against Phantom
2013-07-25 09:07:35 -04:00

29 lines
762 B
PowerShell

$package = 'CasperJS'
try {
$installPath = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root
if (!(Test-Path $installPath))
{
$installPath = Join-Path $Env:SystemDrive 'tools'
}
$installPath = Join-Path $installPath 'casperjs'
if (Test-Path $installPath)
{
Remove-Item $installPath -Recurse -Force
}
$binLocation = $installPath -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
}