Title: Add Levels/Count/AncestorCount to Split-Path -Parent parameter set · Issue #6659 · PowerShell/PowerShell · GitHub
Open Graph Title: Add Levels/Count/AncestorCount to Split-Path -Parent parameter set · Issue #6659 · PowerShell/PowerShell
X Title: Add Levels/Count/AncestorCount to Split-Path -Parent parameter set · Issue #6659 · PowerShell/PowerShell
Description: I quite often end up in situations where I need to remove a known number of directories from the end of a path. Today, it requires a looping or piping multiple times to split-path. $ancestorLevel = 4 $p = "a\b\c\d\e\f" while($ancestorLev...
Open Graph Description: I quite often end up in situations where I need to remove a known number of directories from the end of a path. Today, it requires a looping or piping multiple times to split-path. $ancestorLevel =...
X Description: I quite often end up in situations where I need to remove a known number of directories from the end of a path. Today, it requires a looping or piping multiple times to split-path. $ancestorLevel =...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/6659
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add Levels/Count/AncestorCount to Split-Path -Parent parameter set","articleBody":"I quite often end up in situations where I need to remove a known number of directories from the end of a path.\r\n\r\nToday, it requires a looping or piping multiple times to split-path.\r\n\r\n```powershell\r\n$ancestorLevel = 4\r\n$p = \"a\\b\\c\\d\\e\\f\"\r\nwhile($ancestorLevel--){\r\n $p = split-path $p\r\n}\r\n$p\r\n```\r\n\r\nWhat is the opinion around having the following?\r\n\r\n```powershell\r\nSplit-Path -Parent a\\b\\c\\d\\e\\f -AncestorLevel 2\r\na\\b\\c\\d\r\n\r\nSplit-Path -Parent a\\b\\c\\d\\e\\f -AncestorLevel 4\r\na\\b\r\n```\r\n\r\nBetter naming is left as an exercise for attentive readers with English as their native toungue.\r\n\r\n\r\n","author":{"url":"https://github.com/powercode","@type":"Person","name":"powercode"},"datePublished":"2018-04-14T20:44:06Z","url":"https://github.com/PowerShell/PowerShell/issues/6659"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:00f309ed-fbf8-164d-26f4-915d6b962df1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DD6:195106:139B84:1B1435:6AFD9CCD |
| html-safe-nonce | 6e62c46f844d130edd785234d7c81fbb18604e55aad690f0ede2ad768d2b8ca4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REQ2OjE5NTEwNjoxMzlCODQ6MUIxNDM1OjZBRkQ5Q0NEIiwidmlzaXRvcl9pZCI6IjcxNzI5MTI2MzgxNjkyOTE5ODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c0d10597fee81467b2c6f40309055e53a102a0d1c3ea12c58fe2aad188328707 |
| hovercard-subject-tag | issue:314360394 |
| 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/6659/issue_layout |
| twitter:image | https://opengraph.githubassets.com/314c4f571c443f183a6ca5acb22c2d797ba627e7f2801b0fe3d1aeb702734ce9/PowerShell/PowerShell/issues/6659 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/314c4f571c443f183a6ca5acb22c2d797ba627e7f2801b0fe3d1aeb702734ce9/PowerShell/PowerShell/issues/6659 |
| og:image:alt | I quite often end up in situations where I need to remove a known number of directories from the end of a path. Today, it requires a looping or piping multiple times to split-path. $ancestorLevel =... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | powercode |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| 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 | 927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width