From c9428b1d9c2186910939dc9c87b26129b80cebe4 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 10 Sep 2026 04:10:10 +0000 Subject: [PATCH] test: try fixing windows build replacing WMIC Signed-off-by: James M Snell --- test/common/child_process.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/common/child_process.js b/test/common/child_process.js index c74154bb084f..59505e5824dd 100644 --- a/test/common/child_process.js +++ b/test/common/child_process.js @@ -15,12 +15,12 @@ function cleanupStaleProcess(filename) { process.once('beforeExit', () => { const basename = filename.replace(/.*[/\\]/g, ''); try { - execFileSync(`${process.env.SystemRoot}\\System32\\wbem\\WMIC.exe`, [ - 'process', - 'where', - `commandline like '%${basename}%child'`, - 'delete', - '/nointeractive', + execFileSync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, [ + '-NoProfile', + '-NonInteractive', + '-Command', + `Get-CimInstance Win32_Process -Filter "CommandLine LIKE '%${basename}%child'" | ` + + 'ForEach-Object { Stop-Process -Id $_.ProcessId -Force }', ]); } catch { // Ignore failures, there might not be any stale process to clean up.