Title: `Get-Process`: Add a switch that limits retrieval to the current user's own processes · Issue #21301 · PowerShell/PowerShell · GitHub
Open Graph Title: `Get-Process`: Add a switch that limits retrieval to the current user's own processes · Issue #21301 · PowerShell/PowerShell
X Title: `Get-Process`: Add a switch that limits retrieval to the current user's own processes · Issue #21301 · PowerShell/PowerShell
Description: Summary of the new feature / enhancement When retrieving processes - either with or without a -Name filter - it would be helpful to allow limiting the set of candidate processes to the current user's own processes, say with a newly intro...
Open Graph Description: Summary of the new feature / enhancement When retrieving processes - either with or without a -Name filter - it would be helpful to allow limiting the set of candidate processes to the current user...
X Description: Summary of the new feature / enhancement When retrieving processes - either with or without a -Name filter - it would be helpful to allow limiting the set of candidate processes to the current user...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/21301
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`Get-Process`: Add a switch that limits retrieval to the current user's own processes","articleBody":"### Summary of the new feature / enhancement\r\n\r\nWhen retrieving processes - either with or without a `-Name` filter - it would be helpful to allow limiting the set of candidate processes to the current user's _own_ processes, say with a newly introduced `-CurrentUser` (or `-User`) switch\r\n\r\n```powershell\r\n# WISHFUL THINKING\r\n\r\n# Only retrieve processes started with the current user identity.\r\nGet-Process -CurrentUser\r\n\r\n# Only retrieve `cmd` processes started with the current user identity.\r\nGet-Process -CurrentUser -Name cmd\r\n```\r\n\r\nIt is often only one's own processes that are of interest, especially when running _non-elevated_.\r\n\r\nIn non-elevated sessions, there's currently no easy way to determine which processes are one's own.\r\n_Update_: One's own means: all processes running with the current user identity, irrespective of how they were started - see discussion in the next two comments.\r\n\r\nEven in elevated sessions the solution is cumbersome:\r\n`Get-Process -IncludeUserName | Where UserName -eq $env:USERDOMAIN\\$env:USERNAME`\r\n\r\n\r\n### Proposed technical implementation details (optional)\r\n\r\nAdd the new switch only to the `Name` parameter set.\r\n\r\nIt would be the (possibly `-Name`-filtered) equivalent of the following, which on Windows can currently only be run with elevation:\r\n\r\n```powershell\r\n#requires -RunAsAdministrator\r\nGet-Process -IncludeUserName | \r\n Where UserName -eq ($IsWindows ? \"$env:USERDOMAIN\\$env:USERNAME\" : $env:USER)\r\n```\r\n\r\n\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2024-03-04T18:04:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/21301/PowerShell/issues/21301"}
| 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:f173b367-4af7-3164-4d27-8d7f70183041 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9492:1748BD:17BABA6:22AB99E:6A5636E4 |
| html-safe-nonce | 6be5bef2a3dbf1e3db0581449892f5f7dd231a658296db270e073657130aa275 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDkyOjE3NDhCRDoxN0JBQkE2OjIyQUI5OUU6NkE1NjM2RTQiLCJ2aXNpdG9yX2lkIjoiMzIzOTI4MzIxMjgwODUwMDk2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 30a0399582b612a1ff3649701eaf8c33b9b49e6c64472463c2397d1b60f15a25 |
| hovercard-subject-tag | issue:2167431839 |
| 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/21301/issue_layout |
| twitter:image | https://opengraph.githubassets.com/20ef23d839ace2c764f54b11863e95815369148d063504bd176be4ff63c4ebcb/PowerShell/PowerShell/issues/21301 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/20ef23d839ace2c764f54b11863e95815369148d063504bd176be4ff63c4ebcb/PowerShell/PowerShell/issues/21301 |
| og:image:alt | Summary of the new feature / enhancement When retrieving processes - either with or without a -Name filter - it would be helpful to allow limiting the set of candidate processes to the current user... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d78ea552aac0685ca5f006d44f88166cbbf3bb96843f8da0c5a2c0b9908430b |
| 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 | 423b2fb76ac2b90de5ab599b7a76a0d2b2c83f24 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width