diff --git a/agent-windows/ws/handler.go b/agent-windows/ws/handler.go index 7f0cd75..50ae2bc 100644 --- a/agent-windows/ws/handler.go +++ b/agent-windows/ws/handler.go @@ -235,9 +235,7 @@ func (h *Handler) handleReboot(msg Message) Message { // Hilfsfunktionen func runWithTimeout(command string, timeoutSecs int) (string, error) { - // PowerShell verwenden — unterstuetzt winget, UTF-8, moderne Windows-Befehle - cmd := exec.Command("powershell", "-NoProfile", "-NonInteractive", - "-OutputEncoding", "UTF8", "-Command", command) + cmd := exec.Command("powershell", "-NoProfile", "-NonInteractive", "-Command", command) out, err := withTimeout(cmd, time.Duration(timeoutSecs)*time.Second) return out, err } diff --git a/frontend/src/components/WindowsPanel.jsx b/frontend/src/components/WindowsPanel.jsx index 01796b7..f76678d 100644 --- a/frontend/src/components/WindowsPanel.jsx +++ b/frontend/src/components/WindowsPanel.jsx @@ -415,7 +415,7 @@ function WindowsUpdatesTab({ agentId }) { const [checking, setChecking] = useState(false) const [installing, setInstalling] = useState(false) - const script = `$s = New-Object -ComObject Microsoft.Update.Session; $r = $s.CreateUpdateSearcher().Search("IsInstalled=0 and Type='Software'"); $r.Updates | ForEach-Object { Write-Output "KB$($_.KBArticleIDs[0]) — $($_.Title)" }; Write-Output "---"; Write-Output "Gesamt: $($r.Updates.Count) Updates ausstehend"` + const script = `$s = New-Object -ComObject Microsoft.Update.Session; $r = $s.CreateUpdateSearcher().Search("IsInstalled=0 and Type='Software'"); $r.Updates | ForEach-Object { $kb = if ($_.KBArticleIDs.Count -gt 0) { "KB$($_.KBArticleIDs[0])" } else { "---" }; Write-Output "$kb - $($_.Title)" }; Write-Output ""; Write-Output "Gesamt: $($r.Updates.Count) Updates ausstehend"` const check = async () => { setChecking(true)