Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reflect Powershell CmdLet using Jetbrains DotPeek

Reflect Powershell CmdLet using Jetbrains DotPeek. Credit to Nivok Ink for his version using Redgate Reflector.

function Peek-Cmdlet {
param(
[Management.Automation.CommandInfo]$command
)
if ($input) {
trap { $_; break }
$command = $input | select -first 1
}
# resolve to command if this is an alias
while ($command.CommandType -eq "Alias") {
$command = Get-Command ($command.definition)
}
$name = $command.ImplementingType
$dll = $command.DLL
$inspector = "C:\Program Files (x86)\JetBrains\dotPeek\v1.1\Bin\dotPeek32.exe"
& $inspector /select=$dll!$name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.