Repository navigation
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.
Description
There really should not be any commands with a switch like -Paged or -Paging except Out-Host
Granted, the -Paging switch on Out-Host needs improvement, but we definitely do not want that better implementation to come on some other command! That would just be confusing!
Some thoughts regarding Get-Help -Paged that seem obvious, but which don't appear to have been address. (I'll admit I've been off in la-la land for awhile, but I'm reasonably sure there's no RFC, and I can't find anywhere else this has been discussed).
- To help new users (by making the help more usable), we should do so in a manner that's consistent with how the rest of PowerShell works, rather than breaking the PowerShell output model by having a
Getcommand swap to another output buffer instead of streaming output. Maybe you meant to write aShow-Helpcommand? - To improve paging in PowerShell, we should improve
Out-Host -Paging. It's terribly minimal right now, and I doubt anyone uses it in lieu ofmoreormostorlessexcept in very locked-down environments. - To avoid needing to write
| oh -pa(or| Out-Host -Paging) we should create a way to provide hints to the default host output that we want paging, rather than build a whole new pager into the Help command. Perhaps a magic property on the object, or an ANSI sequence (or something) thatOut-Hostcould pick up on -- something that any command could set to trigger the behavior. If we did that, maybe we could even make-Pageda common parameter...
Reacted by Mike Shepard, gaelcolas, Mark Otzen, Andrew Pearce, James O'Neill, Rain Sallow (/u/ta11ow), Willi Fritz, Patrick Meinecke, Thomas Nieto, Flavien MICHALECZEK and 7 more
Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.
Activity
SteveL-MSFT commentedon Aug 18, 2020
cc Aditya Patwardhan (@adityapatwardhan) Jason Helmick (@theJasonHelmick)
vexx32 commentedon Aug 18, 2020
Fully agreed. Though IMO a separate Out-Pager command is fine if we want an easier/more discoverable way to expose more advanced features / customisation options of the pager.
jhoneill commentedon Aug 18, 2020
TLDR YES to what Joel Bennett (@Jaykul) said. There's a working standardized way already, a new way would only add novelty, is no more convenient and in some cases makes things worse.
In Detail:
Pagination using
| morewas set as the norm in the 1970s, it was incorporated in the first versions of MS-DOS and has carried through to the present day. Better paginators have been created (e.g.less). Some commands will always want| paginatorAdding
-Pagedto the end of command does not save anything over typing|more. To pre-empt "Golf" practitioners, where --pis unique that can be used, but it won't always be valid, however one can makepand alias for one's preferred paginator and|pwill always be validI can see some superficial attraction, to adding
-Pagedas a common parameter handled outside a cmdlet or function. We do it for error action, variables etc, so why not? Because it blurs a distinction that goes right back to the monad manifesto: Output and Printing to the console are not the same thing: it's a founding principle that getting stuff, processing stuff, and printing stuff nicely (for some arbitrary value of 'nice') are distinct activities.The reason there isn't and shouldn't be a pagination switch for getting or processing commands is the same reason there aren't
-Listor-Tableparameters : things to shift from outputting objects into the pipeline , towards printing strings on a terminal (including marking up data for display in colour) should be in their own commands at the end of a pipeline or in the default formatting data used when the object has nowhere to go but the console.It's quite common for a command to evolve
dir -Recurse -Pat~\Pictures\ -include o*then
dir -Recurse -Pa ~\Pictures\ -include o* | sort extensionthen
dir -Recurse -Pa ~\Pictures\ -include o* | where length -gt 10mb | sort extensionIgnoring page breaking the short form of path, would this work correctly, or would he page switch be walked down the pipeline as it grows?
dir -Recurse -Page -Path ~\Pictures\ -include o* | sort extensionadityapatwardhan commentedon Aug 18, 2020
All the feedback here is highly appreciated! I have already started a issue to collect feedback for Pager here: #13405
I have linked these two issues. The idea was to be a conversation starter and
Get-Help -Pagedis not set in stone.iSazonov commentedon Aug 19, 2020
Let's discuss only in #13405