Skip to content

Request: Improve user experience of Get-WinEvent -FilterHashtable #9239

@HumanEquivalentUnit

Description

@HumanEquivalentUnit

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:

  1. 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> ?
  2. 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.
  3. 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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions