Search-DbgHeap.ps1
param($Type) $command = "!dumpheap" if($Type) { $command += " -Type $Type" } $results = Invoke-DbgCommand $command foreach($result in $results) { if($result -match "^([0-9a-f]+)\s+([0-9a-f]+)\s+([0-9a-f]+)$") { $address = $matches[1] $methodTable = $matches[2] $size = $matches[3] if($size -as [Decimal]) { [PSCustomObject] @{ Address = $address MethodTable = $methodTable Size = $size } } } } |