Every time I write a script, or code that uses WMI extensively, I tend to use the System.Management
API. It's straight forward, flexible, and intuitive.
However, This time I decided to use the Microsoft.Management.Infrastructure
API, which contains the famous CimCmdlets
.
Part of my script needs to delete a CIM Class, but I can't find how, using only CIM
.
I know there's the System.Management.ManagementClass.Delete()
method, but can't seem to find something similar.
I tried Microsoft.Management.Infrastructure.CimSession.DeleteInstance()
, but of course it doesn't work.
Can't find documentation on it anywhere. Any ideas?
Edit: I want to delete the class itself, not the class instancess.