Disassembling C# Code

by Jul 12, 2013

Adam Driscoll, another PowerShell MVP, has published a function called Get-MemberBody to PoshCode: http://poshcode.org/4127. In conjunction with the free tool "ILSpy", you now can easily disassemble and look at source codes for .NET functions.

After you download the function along with the tool "ILSpy", you can do nice tricks like this one:

You get a date from Get-Date, pick the method AddTicks() and then let Get-MemberBody decompile the relevant source code. The result is C# code that explains how AddTicks() works.

And this would give you the source code for the Visual Basic static InputBox method:

Twitter This Tip! ReTweet this Tip!