Skip to content

Commit

Permalink
Format COM proxies from a COMProcessEntry instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranid committed Mar 23, 2019
1 parent 4e9f220 commit 15647d8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions OleViewDotNet.PowerShell/OleViewDotNet.psm1
Expand Up @@ -1814,6 +1814,8 @@ This cmdlet formats a COM proxy object or IPID entry as text.
The proxy or IPID entry to format.
.PARAMETER Flags
Specify flags for the formatter.
.PARAMETER Process
Format the IPIDs of a COM process.
.INPUTS
OleViewDotNet.IProxyFormatter
.OUTPUTS
Expand All @@ -1832,15 +1834,24 @@ $ipids | Format-ComProxy
Format a list of IPIDs as text.
#>
function Format-ComProxy {
[CmdletBinding()]
[CmdletBinding(DefaultParameterSetName="FromProxy")]
Param(
[parameter(Mandatory, Position=0, ValueFromPipeline)]
[parameter(Mandatory, Position=0, ValueFromPipeline, ParameterSetName="FromProxy")]
[OleViewDotNet.IProxyFormatter]$Proxy,
[parameter(Mandatory, Position=0, ValueFromPipeline, ParameterSetName="FromProcess")]
[OleViewDotNet.COMProcessEntry]$Process,
[OleViewDotNet.ProxyFormatterFlags]$Flags = 0
)

PROCESS {
$Proxy.FormatText($Flags) | Write-Output
switch($PSCmdlet.ParameterSetName) {
"FromProxy" {
$Proxy.FormatText($Flags) | Write-Output
}
"FromProcess" {
$Process.Ipids | Format-ComProxy -Flags $Flags
}
}
}
}

Expand Down

0 comments on commit 15647d8

Please sign in to comment.