Title: PS7: Get-Item and Get-ChildItem slow on UNC paths because it enumerates parent directories · Issue #12795 · PowerShell/PowerShell · GitHub
Open Graph Title: PS7: Get-Item and Get-ChildItem slow on UNC paths because it enumerates parent directories · Issue #12795 · PowerShell/PowerShell
X Title: PS7: Get-Item and Get-ChildItem slow on UNC paths because it enumerates parent directories · Issue #12795 · PowerShell/PowerShell
Description: Enterprise environment, have a central file server with home drives for each employee (~4,000). Each employee has a path like \\SERVER.DOMAIN.COM\share\home\EMPLOYEEID, and also has it mapped to H:\. In Powershell 7.01, cmdlets like Get-...
Open Graph Description: Enterprise environment, have a central file server with home drives for each employee (~4,000). Each employee has a path like \\SERVER.DOMAIN.COM\share\home\EMPLOYEEID, and also has it mapped to H:...
X Description: Enterprise environment, have a central file server with home drives for each employee (~4,000). Each employee has a path like \\SERVER.DOMAIN.COM\share\home\EMPLOYEEID, and also has it mapped to H:...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/12795
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PS7: Get-Item and Get-ChildItem slow on UNC paths because it enumerates parent directories","articleBody":"Enterprise environment, have a central file server with home drives for each employee (~4,000). Each employee has a path like `\\\\SERVER.DOMAIN.COM\\share\\home\\EMPLOYEEID`, and also has it mapped to `H:\\`.\r\n\r\nIn Powershell 7.01, cmdlets like `Get-Item` and `Get-ChildItem` take far longer to run against the UNC path than the corresponding mapped drive path. Powershell 6.x and 5.1 do not exhibit this.\r\n\r\nTools like Wireshark and Process Monitor suggest that pwsh is traversing the path, getting a full directory list at each level. For example, if I run `Get-Item \\\\SERVER.DOMAIN.COM\\share\\home\\MYID\\folder`, I will see in Wireshark all employee ID folder names in packet data as it enumerates at the `\\\\SERVER.DOMAIN.COM\\share\\home` level.\r\n\r\n# Steps to reproduce\r\n```powershell\r\nGet-Item \\\\SERVER.DOMAIN.COM\\share\\home\\MYID\\folder #Slow\r\nGet-Item H:\\folder #Fast\r\n```\r\n\r\n# Expected behavior\r\n\r\n```powershell\r\n#Only perform the necessary SMB request. Do not enumerate parent folders\r\nGet-Item \\\\SERVER.DOMAIN.COM\\share\\home\\MYID\\folder\r\n```\r\n\r\n# Environment data\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 7.0.1\r\nPSEdition Core\r\nGitCommitId 7.0.1\r\nOS Microsoft Windows 10.0.18363\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n\r\nAlso have PS6 and PS5 installed.\r\n```","author":{"url":"https://github.com/jgard","@type":"Person","name":"jgard"},"datePublished":"2020-05-26T14:27:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/12795/PowerShell/issues/12795"}
| 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:7f1ecbdb-1875-5712-e621-6ed5cfd90d39 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B10E:3FC1F4:14687CC:1D7E2B9:6A577F7E |
| html-safe-nonce | 81eb480e8b31c126854165b7750a5c000e6c5a1b7535e68daba16d8083bdf148 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTBFOjNGQzFGNDoxNDY4N0NDOjFEN0UyQjk6NkE1NzdGN0UiLCJ2aXNpdG9yX2lkIjoiNTQ2MDkxNzQ3ODMwOTE5OTc0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 764ba2fff8d0112ebc1604ceacaa3116c28fd91afc90e9d3a9718c79e80c5135 |
| hovercard-subject-tag | issue:624926541 |
| 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/12795/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d17f0c80203355ed28f363903f0d71efc5052926f1b34ae64060bbfcff26c2a6/PowerShell/PowerShell/issues/12795 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d17f0c80203355ed28f363903f0d71efc5052926f1b34ae64060bbfcff26c2a6/PowerShell/PowerShell/issues/12795 |
| og:image:alt | Enterprise environment, have a central file server with home drives for each employee (~4,000). Each employee has a path like \\SERVER.DOMAIN.COM\share\home\EMPLOYEEID, and also has it mapped to H:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jgard |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6353e56e94423c9cd5abde7708a859afa36a0c1203c73749055bf6ee6704cd0 |
| 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 | 9a9dfe2eff5c790a030f34cfcc89b4bf3ba08c7c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width