Using AsyncCallback in Powershell


I have to call a method on .NET object which is defined as

IAsyncResult BeginListMetrics( ListMetricsRequest listMetricsRequest,
AsyncCallback callback, Object state )

Is it possible to use a powershell function as a AsyncCallback delegate? How?


Scriptblocks can be converted into most types of delegates by casting as follows.


Using AsyncCallback in Powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply