i am trying to get the PID for services and i want to store that in an array
$services = get-service
foreach ($service in $services)
{
$pid = (gwmi win32_Service | where { $_.Name -eq $service}).ProcessID
}
How can i store all values in an array and retrive