Hi, I am trying to write a script to get details on a specific service in PS 7, Get-service | ?($_.displayname -match "Windows Insider Service")
I get
Service ‘McpManagementService (McpManagementService)’ cannot be queried due to the following error:
but no error is displayed.
Then I try in a traditional powershell window I get nothing.
Is there a config or dll missing in my environment?
Thanks in advance
So many thanks for your help, yes the 2 work fine. But tell me, what is this service and why it is failing with PS? I need to write a couple of scripts but dont like to put -Exclude everywhere, in my scripts, I will try to match 3 or 4 services in different places. So, is there any fix for PS7? What is strange in Ps 5, it doesnt error, it returns nothing as follows
I get nothing as well and no errors. When I issue only Get-service
I see that there are several SQL … services as you can notice so nnot match nor like works as well on the server . This iis happening PS7 and Traditional PS
It’s considered best practice to filter as far to the left as possible; i.e. request only what you need, rather than request everything then filter with Where-Object.