Title: Common Parameters should include a CancellationToken · Issue #19685 · PowerShell/PowerShell · GitHub
Open Graph Title: Common Parameters should include a CancellationToken · Issue #19685 · PowerShell/PowerShell
X Title: Common Parameters should include a CancellationToken · Issue #19685 · PowerShell/PowerShell
Description: Summary of the new feature / enhancement There have been a number of requests to add timeouts to various commands ( why always in seconds ? ) it would be simpler to add CancellationToken support to Common Parameters so that all commands ...
Open Graph Description: Summary of the new feature / enhancement There have been a number of requests to add timeouts to various commands ( why always in seconds ? ) it would be simpler to add CancellationToken support to...
X Description: Summary of the new feature / enhancement There have been a number of requests to add timeouts to various commands ( why always in seconds ? ) it would be simpler to add CancellationToken support to...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/19685
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Common Parameters should include a CancellationToken","articleBody":"### Summary of the new feature / enhancement\n\nThere have been a number of requests to add timeouts to various commands ( why always in seconds ? ) it would be simpler to add [CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken?view=net-7.0) support to [Common Parameters](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7.3) so that all commands automatically have the capability in a consistent manner.\r\n\r\nWhile superficially a timeout might seem obvious and simple, a CancellationToken is far more useful and allows the client control over when the cancellation is requested, eg not just because of a timeout but because some other condition occurred after the command has been started.\n\n### Proposed technical implementation details (optional)\n\nProof of concept\r\n\r\nThis demonstrates a cancellation token working with Invoke-Command\r\n\r\nImplementation - [CommandWithCancellationToken.cs](https://github.com/rhubarb-geek-nz/CancellationTokenEvent/blob/main/CancellationTokenEvent/CommandWithCancellationToken.cs)\r\n\r\nUnit tests - [CommandWithCancellationTokenTests.cs](https://github.com/rhubarb-geek-nz/CancellationTokenEvent/blob/main/UnitTests/CommandWithCancellationTokenTests.cs)\r\n\r\n","author":{"url":"https://github.com/rhubarb-geek-nz","@type":"Person","name":"rhubarb-geek-nz"},"datePublished":"2023-05-20T16:51:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/19685/PowerShell/issues/19685"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4bf64f08-21d7-7c93-6720-3e347eef1412 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E64E:1B9CED:420D40:57A53B:6A5044AF |
| html-safe-nonce | 08d4da848b31c1e1fb92dbfa9aff39d0b4b2ba639ea17dcd3bbc93ea0405b874 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjRFOjFCOUNFRDo0MjBENDA6NTdBNTNCOjZBNTA0NEFGIiwidmlzaXRvcl9pZCI6IjYxNzA1NTIwNDk2MzA5ODc0MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 065e97870a3e883c0e465b3f94e7757748ccb947f6c7dc21667c852f24b2c6c5 |
| hovercard-subject-tag | issue:1718225636 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/19685/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d633b7d9fa3a29797a6b04afb8ed0b7edb83d40c18cc142ba59e383980c5b43b/PowerShell/PowerShell/issues/19685 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d633b7d9fa3a29797a6b04afb8ed0b7edb83d40c18cc142ba59e383980c5b43b/PowerShell/PowerShell/issues/19685 |
| og:image:alt | Summary of the new feature / enhancement There have been a number of requests to add timeouts to various commands ( why always in seconds ? ) it would be simpler to add CancellationToken support to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rhubarb-geek-nz |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d90666eaf032b7eb8975a378efe38e37f4ebb96c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width