Title: Windows: PowerShell reports a broken `subst.exe` drive as nonexistent · Issue #20894 · PowerShell/PowerShell · GitHub
Open Graph Title: Windows: PowerShell reports a broken `subst.exe` drive as nonexistent · Issue #20894 · PowerShell/PowerShell
X Title: Windows: PowerShell reports a broken `subst.exe` drive as nonexistent · Issue #20894 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/20894
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Windows: PowerShell reports a broken `subst.exe` drive as nonexistent","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nRelated:\r\n* #20861\r\n\r\nHowever, the issue at hand isn't specific to v7.4.0 and dates back to Windows PowerShell.\r\n\r\n```powershell\r\n# On Windows\r\n\r\n# Establish a T: drive pointing to a temp. directory\r\nsubst T: /d 2>$null\r\nsubst T: ($dir = New-Item -Type Directory -Force \"$env:TEMP:\\$PID\")\r\n# Remove the temp. directory, which leaves T: in a broken state.\r\n$dir | Remove-Item\r\n\r\n# Try to get information about T:, which should still be possible\r\n[System.IO.DriveInfo]::new('T')\r\nGet-PSDrive T\r\n```\r\n\r\n### Expected behavior\r\n\r\n```console\r\nName : T:\\\r\nIsReady : False\r\nRootDirectory : T:\\\r\nDriveType : NoRootDirectory\r\nDriveFormat :\r\nAvailableFreeSpace :\r\nTotalFreeSpace :\r\nTotalSize :\r\nVolumeLabel :\r\n\r\nCurrentLocation :\r\nName : T\r\nProvider : Microsoft.PowerShell.Core\\FileSystem\r\nRoot : T:\\\r\nDescription :\r\nMaximumSize :\r\nCredential : System.Management.Automation.PSCredential\r\nDisplayRoot :\r\nVolumeSeparatedByColon : True\r\nUsed : \r\nFree :\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\nName : T:\\\r\nIsReady : False\r\nRootDirectory : T:\\\r\nDriveType : NoRootDirectory\r\nDriveFormat :\r\nAvailableFreeSpace :\r\nTotalFreeSpace :\r\nTotalSize :\r\nVolumeLabel :\r\n\r\nGet-PSDrive: \r\nLine |\r\n 6 | Get-PSDrive T\r\n | ~~~~~~~~~~~~~\r\n | Cannot find drive. A drive with the name 'T' does not exist.\r\n```\r\n\r\nThat is, PowerShell now thinks the drive _no longer exists_, even though it still does, albeit in a broken state.\r\n\r\n`cmd /c dir T:` doesn't complain about a missing _drive_, but a missing _file_ (presumably the generic `0x2` system error that indicates a non-existent file or directory).\r\n\r\n\r\n### Error details\r\n\r\n_No response_\r\n\r\n### Environment data\r\n\r\n```powershell\r\nPowerShell 7.4.0 on Windows 11 22H2\r\n```\r\n\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2023-12-11T14:30:32Z","url":"https://github.com/PowerShell/PowerShell/issues/20894"}
| 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:3835a81c-4a9d-ff69-0c60-9cd3c4170b3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87C4:3756EB:1C66D2D:27AE2CF:6AFD0C4B |
| html-safe-nonce | 884339a382bf5d6bb257221fce14034310ce6989034198262e2c28e0036f98a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0M0OjM3NTZFQjoxQzY2RDJEOjI3QUUyQ0Y6NkFGRDBDNEIiLCJ2aXNpdG9yX2lkIjoiODY0MTE1NTYwNDk2NzkxODY2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c039dacd67b8ce78321bfcdf5ef9641caab52f591f8add07168710d7b5f9328d |
| hovercard-subject-tag | issue:2035812141 |
| 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/20894/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ebceedb7406c1af048134c15c6afd157e080dd25ed8e9dda9a1968794152b875/PowerShell/PowerShell/issues/20894 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ebceedb7406c1af048134c15c6afd157e080dd25ed8e9dda9a1968794152b875/PowerShell/PowerShell/issues/20894 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| 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 | b29de2abb97b6307b16270785efeb58b51a117d5a9b659acf00b77aa00e7043b |
| 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 | 8c9e619def6d670dc18a45d3b02cea938c1c7e47 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width