Features
> stuff | One # returns first only
> stuff | Some # returns first 5
> stuff | Some -FromEnd # same, but in reverse
- also saves
one
andsome
's result to the variables$global:One
and$global:Some
- It always returns the real, original objects
- It summarizes typenames and sizes, without breaking those objects in the output stream
The lines CountOf | Format-ShortTypeName
are optional.
They are in some dotfiles
- Format-ShortTypeName @ ninmonkey.console
OutNull
andCountOf
@ dotfiles- taken from one of my personal dotfiles
SeeminglySciences profile, this discord thread has more context
I don't have an easily copy pasted version, and unfortunately it's quite involved, but I do have one in my profile: the actual function: https://github.com/SeeminglyScience/dotfiles/blob/bc31aaaec30343be4788d47b2c08b40d6763268d/Documents/PowerShell/Utility.psm1#L3327-L3355
required context (also the complicated part): https://github.com/SeeminglyScience/dotfiles/blob/bc31aaaec30343be4788d47b2c08b40d6763268d/Documents/PowerShell/Utility.psm1#L132-L267