# # Pending Uninstall.ps1 # # If debugging is not working open PowerShell.exe and paste the command "Set-ExecutionPolicy Bypass -Scope Process" # To remove execution policy: paste in PowerShell the command "Set-ExecutionPolicy Undefined -Scope Process" function RemovedKeys([String] $keyPath) { try { if (Test-Path $keyPath) { Remove-Item "$($keyPath)" -Recurse -verbose } else { Write-Host "KEY not found: $($keyPath)" -foregroundcolor yellow } } catch { Write-Error $_.Exception.ToString() } } function RemoveFolders([String] $FolderPath) { if (Test-Path $FolderPath) { try { $FolderName = $FolderPath + "\*"; Remove-Item $FolderName -Verbose -Force -Recurse Remove-Item $FolderPath -Verbose -Force Write-Host "$($FolderPath) Removed" -foregroundcolor green } catch { Write-Error $_.Exception.ToString() } } else { Write-Host "Folder not found: $($FolderPath)" -foregroundcolor yellow } } try { Write-Host "" Add-Type -AssemblyName 'PresentationFramework' $caption = "Uninstall Atrium Software" $message = "Proceed?" $continue = [System.Windows.MessageBox]::Show($message, $caption, 'YesNo'); if ($continue -eq 'Yes') { RemovedKeys "HKLM:SOFTWARE\CDVI Group\Atrium" RemovedKeys "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{83BE308F-1332-4364-9B57-B7BD46B150A2}" RemoveFolders "C:\ProgramData\CDVI Group\Uninstall\{83BE308F-1332-4364-9B57-B7BD46B150A2}" RemoveFolders "C:\Program Files (x86)\CDVI Group\Atrium" RemoveFolders "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\CDVI Group\Atrium" } } catch { Write-Error $_.Exception.ToString() Read-Host -Prompt "Error. Press Enter to exit" }