4 ms·
Yup. I wondered what the PS equivalent was. So, figure out which WMI class one needs: Get-CimClass | ?{$_ -match 'service'} ok, 'Win32_service' it is, cou
by stinos 6y ago
Yup. I wondered what the PS equivalent was. So, figure out which WMI class one needs:
Get-CimClass | ?{$_ -match 'service'}
ok, 'Win32_service' it is, could've guessed that :) Then:
$svc - Get-WmiObject -Class Win32_service
what can we do with this?
$svc | Get-Member
Lots of options, get some to see if it's what is needed:
$svc | Select-Object -Property Name, PathName, ServiceType | Format-Table
Ok, looks like we need PathName. Sum up and list svchost processes including full descption like the one in services.msc:
$svc | ?{$_.PathName -match 'svchost.exe'} | Select-Object -Property Name, PathName, Description | Format-Table