Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: positional parameters and parameter sets

$
0
0

If you are really curious, download a copy of dotPeek sometime. It’s free, and it’s what I use to investigate how PowerShell’s various bits actually work. You can run this command to identify the DLL and class name of a particular cmdlet:

Get-Command Get-Service | Format-Table DLL, ImplementingType -Wrap

DLL                                                                                                              ImplementingType                                                                                               
---                                                                                                              ----------------                                                                                               
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\v4.0_3.0.0.0__31bf3856ad364e Microsoft.PowerShell.Commands.GetServiceCommand                                                                
35\Microsoft.PowerShell.Commands.Management.dll

So I just load up dotPeek, choose the “Open from GAC” option, point it at Microsoft.PowerShell.Commands.Management.dll, and look for the Microsoft.PowerShell.Commands.GetServiceCommand class.

This does require some understanding of C#, and the decompiled code isn’t always the clearest to read, but it’s very handy for this type of investigation.


Viewing all articles
Browse latest Browse all 13067

Trending Articles