function GetProcessCount($serverName) { $serviceArray = Get-WmiObject -class Win32_Service -computerName $serverName ; $Counter = 0 $serviceArray | foreach { $serviceinfo = "" | select name, state, status $Counter ++; } write-host "Process count"; write-host $Counter; return $Counter }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)