powershell-scripts/windows/Uninstall-IPerf3ServerService.ps1

15 lines
374 B
PowerShell

begin {
$Service = Get-Service -Name iperf3server -ErrorAction SilentlyContinue
}
process {
if ($null -eq $Service) {
Write-Host "Service is not installed"
} else {
try {
& "C:\Program Files\nssm\win64\nssm.exe" remove iperf3server confirm
} catch {
Write-Error "Failed to uninstall service. $_"
}
}
}