cannot find an overload for “delete” and the argument count 0

In Exchange EWS when trying to delete an item you get the following error : cannot find an overload for “delete” and the argument count 0 using

$item.Delete()

 

You need to give it a an enumeration e.g.

They can be found here : http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.deletemode(v=exchg.80).aspx

$item.Delete([Microsoft.Exchange.WebServices.Data.DeleteMode]::HardDelete)

 

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...