19 lines
584 B
PowerShell
19 lines
584 B
PowerShell
param(
|
|
[string]$InstallPath = "C:\Program Files\JR IT Services\HostAvailabilityMonitor",
|
|
[string]$ConfigRoot = "C:\ProgramData\JR IT Services\HostAvailabilityMonitor",
|
|
[switch]$RemoveConfig
|
|
)
|
|
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
if (Test-Path -LiteralPath $InstallPath) {
|
|
Remove-Item -LiteralPath $InstallPath -Recurse -Force
|
|
Write-Host "[INFO] Removed $InstallPath"
|
|
}
|
|
|
|
if ($RemoveConfig -and (Test-Path -LiteralPath $ConfigRoot)) {
|
|
Remove-Item -LiteralPath $ConfigRoot -Recurse -Force
|
|
Write-Host "[INFO] Removed $ConfigRoot"
|
|
}
|