How to get the DLL a cmdlet is loaded from?

4

I'm trying to track down where exactly a cmdlet comes from in Powershell on Windows 8. How do I track this down? I know which Module and such it is, but this doesn't help me to track down the actual DLL it's code is implemented in. How do I track this down?

Earlz

Posted 2012-10-23T19:06:48.977

Reputation: 3 966

Answers

2

You can use the Get-Command cmdlet to return information about a specific cmdlet, then simply return its .DLL property.

For instance, for Get-ChildItem:

(Get-Command Get-ChildItem).DLL

The output would be something like:

C:\Windows\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\1.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Commands.Management.dll

Indrek

Posted 2012-10-23T19:06:48.977

Reputation: 21 756

This command not works with exchange commands like get-queue :( – Daniele Licitra – 2018-11-02T10:49:07.393

1

For example if you wanted to know the DLL for Get-ChildItem:

(get-command get-childitem).dll

EBGreen

Posted 2012-10-23T19:06:48.977

Reputation: 7 834