Get-WinEvent uses -FilterHashtable @{..} as one way to describe which events to retrieve, and the hashtable takes keys like ID, StartTime. But there's no way to find out which keys are valid without reading the help.
This feels like a PS-style design would have exposed those keys as parameters, they would show up for tab completion and introspection, and then splatting would be available for the hashtable use case.
My experience would be better if there was a quick way to see the valid keys without having to refer to the help, so:
- Would it be possible for tab-completion to suggest valid hashtable keys, if the hashtable was being written in this context, e.g.
get-winevent -filterhashtable @{ <tab> ?
- Would it be possible to make
Ctrl-Space suggestions, which currently lists all parameters in a nice view, also support showing some text which isn't parameters - hashtable keys specifically in this case, or in a more general case cmdlets could optionally show a cheatsheet section with some free-form text.
- What about exposing the keys as parameters, making them usable by splatting, and deprecating -FilterHashTable?
(FilterXPath and FilterXml parameters also exist, I have no comment on them, they can stay how they are from my point of view).
Get-WinEvent uses
-FilterHashtable @{..}as one way to describe which events to retrieve, and the hashtable takes keys likeID,StartTime. But there's no way to find out which keys are valid without reading the help.This feels like a PS-style design would have exposed those keys as parameters, they would show up for tab completion and introspection, and then splatting would be available for the hashtable use case.
My experience would be better if there was a quick way to see the valid keys without having to refer to the help, so:
get-winevent -filterhashtable @{ <tab>?Ctrl-Spacesuggestions, which currently lists all parameters in a nice view, also support showing some text which isn't parameters - hashtable keys specifically in this case, or in a more general case cmdlets could optionally show a cheatsheet section with some free-form text.(FilterXPath and FilterXml parameters also exist, I have no comment on them, they can stay how they are from my point of view).