Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20396

Re: Counting Instances of a Process - Help!

$
0
0

I got it to work today -- totally different method.  None of the fun error trapping that xander.snyder had in his but it works!  (Which, after the week I've had banging my head against the wall on this one, is a minor triumph.)

 

$process = Get-WmiObject win32_process -ComputerName '${IP}' -Credential '${CREDENTIAL}' |  Where-Object {$_.Name -eq  "PkMSLaunch.exe" }  |   Measure-Object;

$count = ($process).count

Write-Host 'Statistic: '  $count

Exit(0)

 

Next phase is to do some error traps, etc.

 

(I know --- 4 lines of code shouldn't make me this happy, but they do!)


Viewing all articles
Browse latest Browse all 20396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>