fix: -OutputEncoding entfernt (inkompatibel), KB null-safe, exec via PS

This commit is contained in:
cynfo3000
2026-03-10 02:17:05 +01:00
parent 557e59bfc5
commit a97b17a682
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -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)