I'm having some troubles with WMI queries.
The queries themselves are fine my problem comes when running
Get-WmiObject -class "Win32_Service" -computername $server -Filter "Name = '$instance'" | SELECT Name, State
The code itself works without an issue....except in a situation where a server is hung up and will accept in a WMI query however not return any results.
There isn't any timeout value that can be set on WMI queries (something I find most strange), is anyone aware of a way to force some kind of a timeout value in powershell so that the script will force a timeout value any server that doesn't return data in 10 seconds?