Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .NAME
- Discover-Command
- .SYNOPSIS
- Traces the .NET method being called and the DLL it's in for a given Cmdlet.
- .EXAMPLE
- Discover-Command -Command "Get-Process"
- #>
- function Discover-Command
- {
- [CmdletBinding()]
- Param
- (
- [Parameter(Mandatory=$true,
- ValueFromPipelineByPropertyName=$true,
- Position=0)]
- $Command
- )
- Begin
- {
- }
- Process
- {
- $Discover_DLL = $(Get-Command $Command).DLL;
- $Discover_Method = Trace-Command -Name CommandDiscovery -Command $Command -PSHost | Select-String "DEBUG"
- $Discover_DLL
- $Discover_Method
- }
- End
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement