mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
test: try fixing windows build replacing WMIC
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/65949 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
This commit is contained in:
1 parent
47f814137d
commit
bb79acaae8
1 file changed
+6
-6
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user