2009
06.02

I was trying to use a .NET DLL in a Powershell script I was writing, and for some reason, I could not reference one of the objects created using the interface it implemented; it was an *explicit* interface implementation (as opposed to the more common *implicit*). After having my head spin for a couple of hours, I gave up and googled it…Lo, and behold, a
blog entry from one of the PS afficionados about this exact “issue” (using the term loosely).

Wow, I have to do all of that just to extract the *explicit* interface? Forget that, I will just re-compile the DLL to use implicit interface implementation…wow that sucked.

3 comments so far

Add Your Comment
  1. Methinks that guy didn’t think of the most obvious solution: Just cast the object to the interface and call the method on the casted object. Works just fine in powershell, as far as I can see.

  2. No, actually, that’s the point: what you said doesn’t work with *explicit* implementation (it works with implicit)…

  3. Sure it works. I tried it with a generic collection that implements System.Collections.IEnumerable explicitly.

Spam Protection by WP-SpamFree