|
Re: Process count wrong when only one process matches criteria It's the way PowerShell handles, or mishandles, scalar objects. Wrap the get-process statement in array notation '@()':
$abc | % {
([wmiClass]"\\localhost\ROOT\CIMV2:win32_process").Create("xyz");
while (@(get-process xyz).count -gt 0 {start-sleep 60}
}
--
Kiron |