Fix: add Windows uninstall command support for unified agent

The UI only showed a bash uninstall command which doesn't work on Windows.
Added PULSE_UNINSTALL env var support to install.ps1 and updated the UI
to display platform-specific uninstall commands for both Linux/macOS and
Windows.

Related to #1176
This commit is contained in:
rcourtman 2026-02-03 12:02:52 +00:00
parent 900e05025a
commit c2de5f7f4c

View file

@ -2,6 +2,9 @@
# Usage:
# irm http://pulse/install.ps1 | iex
# $env:PULSE_URL="..."; $env:PULSE_TOKEN="..."; irm ... | iex
#
# Uninstall:
# $env:PULSE_UNINSTALL="true"; irm http://pulse/install.ps1 | iex
param (
[string]$Url = $env:PULSE_URL,
@ -59,6 +62,9 @@ if (-not $PSBoundParameters.ContainsKey('EnableKubernetes') -and -not [string]::
if (-not $PSBoundParameters.ContainsKey('Insecure') -and -not [string]::IsNullOrWhiteSpace($env:PULSE_INSECURE_SKIP_VERIFY)) {
$Insecure = Parse-Bool $env:PULSE_INSECURE_SKIP_VERIFY $Insecure
}
if (-not $PSBoundParameters.ContainsKey('Uninstall') -and -not [string]::IsNullOrWhiteSpace($env:PULSE_UNINSTALL)) {
$Uninstall = Parse-Bool $env:PULSE_UNINSTALL $Uninstall
}
# --- Administrator Check ---
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)