Skip to content
Permalink
Browse files

Format COM proxies from a COMProcessEntry instance.

  • Loading branch information...
tyranid committed Mar 23, 2019
1 parent 4e9f220 commit 15647d8ea8b6e7021bed8b9fee8e3d7e2c79b4c8
Showing with 14 additions and 3 deletions.
  1. +14 −3 OleViewDotNet.PowerShell/OleViewDotNet.psm1
@@ -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
@@ -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
}
}
}
}

0 comments on commit 15647d8

Please sign in to comment.
You can’t perform that action at this time.