Finally, I found the root causes:
I use the command Get-WmiObject -Namespace "root\acim" -ClassName "HwSetting" | Get-Member
to find that the registered method is SetHw(System.String name, System.String value)
, but it doesn't match my setting of SetHw()
which does not have any arguments. So I re-compiled mof by mofcomp.exe.
We must implement GetObjectAsync()
when we use a command like this (Get-WmiObject -Namespace "root\acim" -ClassName "MyHwSetting").MySetHw()