Skip to content

Commit d73535d

Browse files
committed
Simplify expression
1 parent 815e7b9 commit d73535d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AsyncTaskStatus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ private function observeTaskRunnerProcess(): bool
189189
// since we should have remembered the PID, we can just query whether it still exists
190190
// supposedly, the PID has not rolled over yet, right...?
191191
if (OsInfo::isWindows()) {
192-
// Windows uses GCIM to discover processes
193-
$echoedPid = exec("powershell echo \"\"(gcim Win32_Process -Filter \\\"ProcessId = {$this->lastKnownPID}\\\").ProcessId\"\"");
192+
// Windows can also use Get-Process to probe processes
193+
$echoedPid = exec("powershell (Get-Process -id {$this->lastKnownPID}).Id");
194194
if ($echoedPid === false) {
195195
throw new RuntimeException(self::MSG_CANNOT_CHECK_STATUS);
196196
}

0 commit comments

Comments
 (0)