Added PSInvoke and use static invocation at call sites for invoking delegates