Add-GlobalResult A helper which adds PowerShell's auto variable $Global:LastResult This an extended version which works in all cases: it captures arrays, returns immediately and works with Format-* cmdlets