Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-Event -Descending/-First #20444

Open
StartAutomating opened this issue Oct 5, 2023 · 2 comments
Open

Get-Event -Descending/-First #20444

StartAutomating opened this issue Oct 5, 2023 · 2 comments
Labels
In-PR Indicates that a PR is out for the issue Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module WG-NeedsReview Needs a review by the labeled Working Group

Comments

@StartAutomating
Copy link

StartAutomating commented Oct 5, 2023

Summary of the new feature / enhancement

Events are currently a queue. Due to backwards compatibility, this cannot be changed.

However, it's the less common of the two use cases.

In nearly every interactive scenario, one needs to get the most recent event and act upon it.

A good example of this is finding the most recent change from a websocket.

The websocket will broadcast events back indicating a change. Using Get-Event at present, one needs to get the whole list of events and pick off the end.

Proposed technical implementation details (optional)

Get-Event should include a -Descending parameter (possibly aliased to -Stack), which would return the most recent event first. Also add SupportsPagination to the cmdlet so be able to get the -First n results and -Skip a number of items.

@StartAutomating StartAutomating added Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. labels Oct 5, 2023
@StartAutomating StartAutomating changed the title Get-Event -Descending Get-Event -Descending/-First Oct 5, 2023
StartAutomating pushed a commit to StartAutomating/PowerShell that referenced this issue Oct 5, 2023
StartAutomating pushed a commit to StartAutomating/PowerShell that referenced this issue Oct 8, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR Indicates that a PR is out for the issue label Oct 8, 2023
StartAutomating pushed a commit to StartAutomating/PowerShell that referenced this issue Oct 8, 2023
@kilasuit kilasuit added WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module WG-NeedsReview Needs a review by the labeled Working Group labels Oct 9, 2023
@kilasuit
Copy link
Collaborator

kilasuit commented Oct 9, 2023

This makes sense to me as an addition to this cmdlet but have flagged for the Cmdlets WG to review both this issue and PR too.

@StartAutomating
Copy link
Author

Cool. One note, before it comes up:

It appears that SupportsPagination is only valid for Script Cmdlets (the attribute did nothing)

As such, I implemented the two parameters described in SupportsPagination.

StartAutomating pushed a commit to StartAutomating/PowerShell that referenced this issue Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In-PR Indicates that a PR is out for the issue Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module WG-NeedsReview Needs a review by the labeled Working Group
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants