I don't believe KiX can return $ProcessID by reference like VBS can. I think your only choice is to query for it separately and if you have multiple instances, it can get tricky.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.