Code:
add-type @' public interface IFoo { void Foo(); } public class Bar : IFoo { void IFoo.Foo() { } } '@ -Language Csharp $bar = New-Object Bar ($bar -as [IFoo]).Foo() # ERROR.
Error:
Method invocation failed because [Bar] doesn’t contain a method named ‘Foo’.
Bad news: It’s a bug.
https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=249840&SiteID=99