Use Get-Member for reflection


I’d basically like to use reflection in Powershell, and after dynamically finding the methods I’d like to invoke using standard powershell commands, I ended up with a MemberDefinition object and not much clue as to how to invoke it. I’m not positive I can, so if you have experience you can just say not to do it this way. I know I can drop into the Assembly namespace, but didn’t know if I could do something like this:

The $method variable is of type Microsoft.PowerShell.Commands.MemberDefinition, is this even possible?

Thanks, Matthew


Sounds like you’re pretty familiar with .NET, why not just drop down and use reflection directly?


Use Get-Member for reflection by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply