Monthly Archive



Having shown how a new WMI object can be created using Invoke-WmiMethod we need to consider how to remove a WMI Object.  CTP 2 supplies a Remove-WMIObject cmdlet.  This takes a WMI path to identify the individual object or you can use Get-WMIObject to identify object and pipe the result to Remove-WMIObject

Get-WmiObject -Class Win32_process -Filter "Name='notepad.exe'" | Remove-WmiObject

Remove-WMIObject does not support the -whatif and -confirm parameters so best practice is to use get-wmiobject and the filter capability to identify the correct object before piping to Remove-WMIObject


Share this post :

Technorati Tags: Powershell,WMI

Leave a Reply