René's URL Explorer Experiment


Title: Introduce a cmdlet for manipulation of list strings · Issue #7975 · PowerShell/PowerShell · GitHub

Open Graph Title: Introduce a cmdlet for manipulation of list strings · Issue #7975 · PowerShell/PowerShell

X Title: Introduce a cmdlet for manipulation of list strings · Issue #7975 · PowerShell/PowerShell

Description: Note: Should this suggestion gain traction, an RFC is presumably needed. By list string I mean a single string composed of items (tokens) separated by a separator, such as you would find in $env:PATH, which contains a list of directories...

Open Graph Description: Note: Should this suggestion gain traction, an RFC is presumably needed. By list string I mean a single string composed of items (tokens) separated by a separator, such as you would find in $env:PA...

X Description: Note: Should this suggestion gain traction, an RFC is presumably needed. By list string I mean a single string composed of items (tokens) separated by a separator, such as you would find in $env:PA...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/7975

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Introduce a cmdlet for manipulation of list strings","articleBody":"Note:\r\n* Should this suggestion gain traction, an RFC is presumably needed.\r\n* By _list string_ I mean a single string composed of items (tokens) separated by a separator, such as you would find in ` $env:PATH`, which contains a list of directories.\r\n* This suggestion is in part motivated by wanting a platform-independent mechanism for manipulating environment variables such as `$env:PATH` safely and conveniently - see #5340 and \r\nhttps://github.com/PowerShell/PowerShell-RFC/pull/92\r\n\r\nManipulating such lists with text parsing is cumbersome, error-prone, and sometimes requires platform-specific separators, so a dedicated cmdlet, say `Update-ListString` (name negotiable) could ease the burden, by offering the following operations, with support for adding/removing _arrays_ of items:\r\n\r\n* adding items:\r\n   * prepend (`-Prepend`)\r\n   * append (`-Append`)\r\n   * insert before or after a given item  (`-InsertBefore` / `-InsertAfter`) - same as `-Append`, if the item doesn't exist\r\n* replacing items:\r\n  * by name (item string) of an existing item (`-Replace`)  - same as `-Append`, if the item doesn't exist.\r\n* removing items:\r\n  * by name (item string) (`-Remove`)\r\n  * removing duplicate items on request (`-RemoveDuplicate`), keeping only the first occurrence\r\n  * remove empty items (duplicate separators) on request (`-RemoveEmpty`)\r\n\r\nOperations should be idempotent by default (desired-state logic):\r\n   * on adding, quietly do nothing if the item(s) already exist\r\n   * on removing, ignore the case where item(s) don't exist\r\n\r\nWith `-Force`, _add_ operations should enforce the specified position - `-Prepend`, `-Append`, `-InsertAt`, `-InsertBefore/After` - by moving a preexisting item accordingly.\r\n\r\nSeparators can either be specified:\r\n\r\n* freely, as a regex (as you would pass to `-split`), with `-Separator` \r\n* or  via switch `-AsDirList` (name negotiable), in which case `[IO.Path]::PathSeparator` is used, representing the platform-appropriate separator used to separate entries in `$env:PATH` (and similar variables such as `$env:CLASSPATH`).\r\n\r\nOpen questions:\r\n\r\n* Is it necessary to also support _by-index_ operations (`-InsertAt`, `-RemoveAt`, `-ReplaceAt`)? Conceivably, this could be added later.\r\n* How should _escaping_ of separators embedded in items be handled? The simplest case would be to simply _disallow_ embedded separators in items (assume that existing items don't have embedded separators, and report an error on trying to set items containing them). Conceivably, support for escaping could be added later via an `-EscapeChar` parameter.\r\n\r\nExamples:\r\n\r\n```powershell\r\n# WISHFUL THINKING\r\n\r\nPS> Update-ListString -Separator ';' 'a;b;c' -Append 'd', 'e'\r\na;b;c;d;e\r\n\r\nPS> Update-ListString -Separator ';' 'a;b;c' -Prepend 'd'\r\nd;a;b;c\r\n\r\nPS> Update-ListString -Separator ';' 'a;b;c;d' -Remove 'd', 'b'\r\na;c\r\n\r\nPS> Update-ListString -Separator ';' 'a;;c' -RemoveEmpty\r\na;c\r\n\r\nPS> Update-ListString -Separator ';' 'a;b;a;c' -RemoveDuplicate\r\na;b;c\r\n\r\nPS> Update-ListString -Separator ';' 'a;b;c' -Replace 'b', 'd'\r\na;d;c\r\n\r\n# No-op, if entry already present\r\nPS> Update-ListString -Separator ';' 'a;b;c' -Append 'b'\r\na;b;c\r\n\r\n# Enforce specified position\r\nPS> Update-ListString -Separator ';' 'a;b;c' -Append 'b' -Force\r\na;c;b\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\nWritten as of:\r\n\r\n```powershell\r\nPowerShell Core 6.1.0\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2018-10-08T20:01:59Z","url":"https://github.com/PowerShell/PowerShell/issues/7975"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7c12adaa-a34b-6f45-ebd3-bbfe6e3024f5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC706:2F6606:2194F66:2EED86E:6AFD31BD
html-safe-nonce81d78ad8d2d047f2455e6ee3afccd74948f3f7ffdc37c112634f2f09c768c5cb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzA2OjJGNjYwNjoyMTk0RjY2OjJFRUQ4NkU6NkFGRDMxQkQiLCJ2aXNpdG9yX2lkIjoiNjE2NzYwMDYxNjgzNTk4NTg1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac63cda4e1cdb168b450b7e463c58637f19c35242d56dd410b4df9fc8ce1ef37b7
hovercard-subject-tagissue:367932914
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/7975/issue_layout
twitter:imagehttps://opengraph.githubassets.com/30ddc7851a052b99d8b0495e095267645518c74a1b10c00c036c998644b6aeed/PowerShell/PowerShell/issues/7975
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/30ddc7851a052b99d8b0495e095267645518c74a1b10c00c036c998644b6aeed/PowerShell/PowerShell/issues/7975
og:image:altNote: Should this suggestion gain traction, an RFC is presumably needed. By list string I mean a single string composed of items (tokens) separated by a separator, such as you would find in $env:PA...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemklement0
hostnamegithub.com
expected-hostnamegithub.com
None065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release941021edf0c2ec58298f4a2c8f27ae507d129c92
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/7975#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F7975
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F7975
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/7975
Reloadhttps://github.com/PowerShell/PowerShell/issues/7975
Reloadhttps://github.com/PowerShell/PowerShell/issues/7975
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests364 (364)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/7975
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/7975
Introduce a cmdlet for manipulation of list stringshttps://github.com/PowerShell/PowerShell/issues/7975#top
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Discussion%22
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Oct 8, 2018https://github.com/PowerShell/PowerShell/issues/7975#issue-367932914
PowerShell needs shortcut vars for [IO.Path]::PathSeparator and [IO.Path]::DirectorySeparatorChar #5340https://github.com/PowerShell/PowerShell/issues/5340
RFC for *-EnvironmentVariable cmdlets. PowerShell-RFC#92https://github.com/PowerShell/PowerShell-RFC/pull/92
https://github.com/HumanEquivalentUnit
HumanEquivalentUnithttps://github.com/HumanEquivalentUnit
on Oct 8, 2018https://github.com/PowerShell/PowerShell/issues/7975#issuecomment-428013697
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Discussion%22
on Oct 9, 2018https://github.com/PowerShell/PowerShell/issues/7975#event-1891578126
https://github.com/rkeithhill
Keith Hill (rkeithhill)https://github.com/rkeithhill
on Oct 9, 2018https://github.com/PowerShell/PowerShell/issues/7975#issuecomment-428025303
PowerShell/PowerShell-RFC#92https://github.com/PowerShell/PowerShell-RFC/pull/92
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Oct 9, 2018https://github.com/PowerShell/PowerShell/issues/7975#issuecomment-428031027
HumanEquivalentUnithttps://github.com/HumanEquivalentUnit
Michael Klement (mklement0)https://github.com/mklement0
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 9, 2018https://github.com/PowerShell/PowerShell/issues/7975#event-1891627403
Ilya (iSazonov)https://github.com/iSazonov
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
on Oct 30, 2018https://github.com/PowerShell/PowerShell/issues/7975#event-1934123369
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/7975
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/7975
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Discussion%22
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.