Add timeout parameter to Get-WmiObject
Votes from Connect: 82
Original Date Submitted: 2/19/2011 1:58:11 AM
Site Name: PowerShell
Feedback ID: 645165
Frequency: Sometimes Happens
Regression: I don't know if this issue existed previously
Get-WmiObject is commonly used to collect information from a list of remote computers. Most of the time this works correctly, but if WMI is broken on the remote system it can cause a script to hang.
A workaround that implements a custom function was posted here:
Product Studio item created by Connect Synchronizer due to creation of feedback ID 645165 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=645165).
Unable to consistently reproduce.
An optional [-TimeOut <int>] parameter will return an error after the specified amount of seconds has elapsed.
Internal BugId: 2817
I think it is implemented in CimObject, which now supercedes WMI.