while ($true) {$foo=get-date -Format "HH:mm:ss";write-host "$foo Handles: " -NoNewline;Get-Process -Name sysmon64 | select -ExpandProperty Handles; sleep -Seconds 60;$foo=$null}

I detta fallet Sysmon64 en gång varje minut

 

alternativt:

while ($true)
{
$foo=get-date -Format "HH:mm:ss"
$hand=Get-Process -Name sysmon64 | select -ExpandProperty Handles
$MyPID=Get-Process -Name sysmon64 | select -ExpandProperty Id
if($MyPid -eq $MyprintPid)
{
write-host "$foo Handles: $hand"
}
else
{
write-host "$foo Handles: $hand PID: $MyPID"
$MyprintPid = $MyPid
}
sleep -Seconds 10
$foo=$null
}

Som ger PID varje gång den ändras...