14

I am using some cmdlets imported from a module and would like to find out where the DLLs are physically located so that I can use dotPeek or Reflector on them. Is there a way to find out the DLL path somehow?

Borek Bernard
  • 47,195
  • 54
  • 159
  • 231

2 Answers2

23

try with

( get-command my-cmdlet ).dll
Liam
  • 25,247
  • 27
  • 110
  • 174
CB.
  • 56,179
  • 8
  • 151
  • 155
  • This even works with native cmdlets - `( get-command Rename-Item ).dll`. Of course you still have to do some digging to find the actual provider (e.g. `FileSystemProvider` in the GAC's `System.Management.Automation.dll`). – Ohad Schneider Mar 27 '16 at 00:50
2

The accepted answer will work for cmdlets but not native functions such as Add-BgpRouter or Add-PrinterDriver. To determine the file path of a function use

$Function = Get-Command Add-BgpRouter
(Get-Module $Function.ModuleName).Path
pirateofebay
  • 607
  • 8
  • 22