Advertisement
Guest User

Untitled

a guest
May 27th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <#
  2. .NAME
  3. Discover-Command
  4. .SYNOPSIS
  5. Traces the .NET method being called and the DLL it's in for a given Cmdlet.
  6. .EXAMPLE
  7. Discover-Command -Command "Get-Process"
  8. #>
  9. function Discover-Command
  10. {
  11. [CmdletBinding()]
  12. Param
  13. (
  14. [Parameter(Mandatory=$true,
  15. ValueFromPipelineByPropertyName=$true,
  16. Position=0)]
  17. $Command
  18. )
  19. Begin
  20. {
  21. }
  22. Process
  23. {
  24. $Discover_DLL = $(Get-Command $Command).DLL;
  25. $Discover_Method = Trace-Command -Name CommandDiscovery -Command $Command -PSHost | Select-String "DEBUG"
  26.  
  27. $Discover_DLL
  28. $Discover_Method
  29.  
  30. }
  31. End
  32. {
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement