update
This commit is contained in:
+9
-14
@@ -2,24 +2,19 @@
|
||||
$APP_PATH = "${Env:UserProfile}\AppData\Local\Apps\2.0"
|
||||
|
||||
## Test to make sure it's installed for the current user before continuing
|
||||
if ( Test-Path $APP_PATH ) {
|
||||
|
||||
If ( Test-Path $APP_PATH )
|
||||
{
|
||||
## Stop the process if it's currently running
|
||||
try {
|
||||
Try
|
||||
{
|
||||
$Process = Get-Process -Name "DeltekVision" -ErrorAction SilentlyContinue
|
||||
if ( !($Process -eq $null) ) { Stop-Process -Name $ProcessName }
|
||||
}
|
||||
catch {
|
||||
Write-Host "Deltek Vision is running but couldn't be stopped!"; exit
|
||||
If ( !($Process -eq $null) ) { Stop-Process -Name $ProcessName -Force }
|
||||
}
|
||||
Catch { Write-Output "Deltek Vision is running but couldn't be stopped!"; Exit }
|
||||
|
||||
## Delete the existing installed app
|
||||
try {
|
||||
Remove-Item $APP_PATH -Recurse -Force
|
||||
}
|
||||
catch {
|
||||
Write-Host "There was a problem while deleting the installed version of Deltek Vision!"; exit
|
||||
}
|
||||
Try { Remove-Item $APP_PATH -Recurse -Force }
|
||||
Catch { Write-Output "There was a problem while deleting the installed version of Deltek Vision!"; Exit }
|
||||
|
||||
Write-Host "Deltek Vision was successfully uninstalled."
|
||||
Write-Output "Deltek Vision was successfully uninstalled."
|
||||
}
|
||||
Reference in New Issue
Block a user