From 174ac481c81174ca91c8b179f7fddc0e4c4b1f58 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 3 Feb 2026 12:04:46 +0000 Subject: [PATCH] Add Windows uninstall command to UI Update the Uninstall agent section to display both Linux/macOS and Windows uninstall commands with clear platform labels. Related to #1176 --- .../src/components/Settings/UnifiedAgents.tsx | 89 ++++++++++++++----- 1 file changed, 65 insertions(+), 24 deletions(-) diff --git a/frontend-modern/src/components/Settings/UnifiedAgents.tsx b/frontend-modern/src/components/Settings/UnifiedAgents.tsx index b0426e6f5..0c4bd983a 100644 --- a/frontend-modern/src/components/Settings/UnifiedAgents.tsx +++ b/frontend-modern/src/components/Settings/UnifiedAgents.tsx @@ -336,6 +336,16 @@ export const UnifiedAgents: Component = () => { return `curl ${getCurlInsecureFlag()}-fsSL ${url}/install.sh | bash -s -- --uninstall --url ${url}${insecure}`; }; + const getWindowsUninstallCommand = () => { + const url = customAgentUrl() || agentUrl(); + const token = currentToken() || latestRecord()?.id; + // Include URL and token for server notification (removes agent from dashboard) + if (token) { + return `$env:PULSE_URL="${url}"; $env:PULSE_TOKEN="${token}"; $env:PULSE_UNINSTALL="true"; irm $env:PULSE_URL/install.ps1 | iex`; + } + return `$env:PULSE_UNINSTALL="true"; irm ${url}/install.ps1 | iex`; + }; + // Track previously seen host types to prevent flapping when one source temporarily has no data // This preserves types we've seen before even if one array briefly becomes empty let previousHostTypes = new Map>(); @@ -1163,33 +1173,64 @@ export const UnifiedAgents: Component = () => { {/* Uninstall section - always visible */}
-
+

Uninstall agent

- Run this command on any host to remove the Pulse agent: + Run the appropriate command on your host to remove the Pulse agent:

-
- -
-                                    {getUninstallCommand()}
-                                
+ {/* Linux/macOS uninstall */} +
+ Linux / macOS / FreeBSD +
+ +
+                                        {getUninstallCommand()}
+                                    
+
+
+ {/* Windows uninstall */} +
+ Windows (PowerShell as Administrator) +
+ +
+                                        {getWindowsUninstallCommand()}
+                                    
+