Closed lanatmwan closed 10 years ago
Agree. I think '$null = ...' should be preferred.
This was addressed in the new Get-PE - An on-disk, in-memory PE parser, and process dumper that was written from scratch. https://github.com/mattifestation/PowerShellArsenal/blob/master/Parsers/Get-PE.ps1
Thanks for your comment and sorry for the delay. I was planning on rewriting Get-PEHeader all along.
Cheers, Matt
"Use Out-Null to suppress unwanted/irrelevant output." Out-Null is the slowest way to dump unwanted output because it unnecessarily involves the pipeline. It is far faster to cast to [void] or assign the results to $null, which can make a noticeable difference when process things like like log files which may have a lot of output.
For example: [void]$PsBoundParameters.Remove('Foo') $null = $PsBoundParameters.Remove('Foo')