From c7910e4d9d3a6102351f994b35c8a12cd8b63f88 Mon Sep 17 00:00:00 2001 From: Amrutha Kanhirathingal Date: Mon, 10 Feb 2025 15:23:59 +0530 Subject: [PATCH] Replaced deprecated wmic with powershell command to getPid WMIC is deprecated in the latest Windows versions, causing issues in retrieving process IDs. This update switches to PowerShell-based commands for future support Related : runtimes/automation/issues/185 Signed-off-by: Amrutha Kanhirathingal --- test/functional/cmdLineTests/runtimemxbeanTests/getPidTest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/cmdLineTests/runtimemxbeanTests/getPidTest.pl b/test/functional/cmdLineTests/runtimemxbeanTests/getPidTest.pl index 1cd510d00ab..aba877358ff 100644 --- a/test/functional/cmdLineTests/runtimemxbeanTests/getPidTest.pl +++ b/test/functional/cmdLineTests/runtimemxbeanTests/getPidTest.pl @@ -39,7 +39,7 @@ open3($in, $out, $err, $javaCmd); $javaPid = <$out>; # Command gets the list of PIDs of the Java processes system is running - $perlPid = `wmic process where "name='java.exe'" get ProcessID`; + $perlPid = `powershell -Command "& { Get-Process java | Select-Object -ExpandProperty Id }"`; print $in "getPid finished"; # String trim both sides of javaPid and perlPid for the index check $javaPid =~ s/^\s+|\s+$//g;