I getting the following error:
gwmi : Invalid class "WmiMonitorID" At line:1 char:1 + gwmi WmiMonitorID -Namespace root\wmi | ForEach-Object {($_.UserFrie ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidType: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
while trying to grab my monitor's Serial ID using:
gwmi WmiMonitorID -Namespace root\wmi | ForEach-Object {
($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join "";
($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join ""
}
I used this command about 2 months back and it worked flawlessly. (Was not even running PowerShell in admin)
Now with or without admin I get the error mentioned above. (also tried x64 and x86 both with/without admin)
Am I overlooking something?
WMI Control (Local)
looks like the good one in the screenshot – newcoolInvalid Class " WmiMonitorID"
so it might be reading the whitespace. – Drew