Title: Test-Path returns $true for ' ' on Windows · Issue #5717 · PowerShell/PowerShell · GitHub
Open Graph Title: Test-Path returns $true for ' ' on Windows · Issue #5717 · PowerShell/PowerShell
X Title: Test-Path returns $true for ' ' on Windows · Issue #5717 · PowerShell/PowerShell
Description: Steps to reproduce Test-Path ' ' Expected behavior NB: Because the .Net Core method Directory.Exists states in the docs here that trailing whitespaces are removed, the expectation of the last 2 spaces is true. False Actual behavior On Wi...
Open Graph Description: Steps to reproduce Test-Path ' ' Expected behavior NB: Because the .Net Core method Directory.Exists states in the docs here that trailing whitespaces are removed, the expectation of the last 2 spa...
X Description: Steps to reproduce Test-Path ' ' Expected behavior NB: Because the .Net Core method Directory.Exists states in the docs here that trailing whitespaces are removed, the expectation of the la...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/5717
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test-Path returns $true for ' ' on Windows","articleBody":"Steps to reproduce\r\n------------------\r\n\r\n```powershell\r\nTest-Path ' '\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\nNB: Because the .Net Core method Directory.Exists states in the docs [here](https://docs.microsoft.com/en-us/dotnet/api/system.io.directory.exists?view=netcore-2.0#System_IO_Directory_Exists_System_String_) that trailing whitespaces are removed, the expectation of the last 2 spaces is true.\r\n```none\r\nFalse\r\n```\r\n\r\nActual behavior\r\n---------------\r\nOn Windows:\r\n```none\r\nTrue\r\n```\r\nOn Linux (Ubuntu 17 or WSL):\r\n```none\r\nFalse\r\n```\r\n\r\nEnvironment data\r\n----------------\r\nReproes on the latest daily build of `PowerShell Core` (December 19, 2017) and `Windows PowerShell 5.1`\r\n\r\n```powershell\r\n\u003e $PSVersionTable\r\nName Value\r\n---- -----\r\nPSVersion 6.1.0-preview.519\r\nPSEdition Core\r\nGitCommitId v6.1.0-preview.519\r\nOS Microsoft Windows 6.3.9600\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\n```\r\nUbuntu 17 VM\r\n````\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-rc.2\r\nPSEdition Core\r\nGitCommitId v6.0.0-rc.2\r\nOS Linux 4.10.0-42-generic #46-Ubuntu SMP Mon Dec 4 14:38:01 UTC 2017\r\nPlatform Unix\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\n````\r\nThe WSL Linux system\r\n````\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-rc.2\r\nPSEdition Core\r\nGitCommitId v6.0.0-rc.2\r\nOS Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014\r\nPlatform Unix\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\n","author":{"url":"https://github.com/bergmeister","@type":"Person","name":"bergmeister"},"datePublished":"2017-12-19T17:39:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/5717/PowerShell/issues/5717"}
| 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:5be5c81b-7cbf-2bbe-1b1a-ee1717fab7fb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9992:3B1998:2198422:2D621A1:6A59A489 |
| html-safe-nonce | 41aa38355f9b08a1f3dcfc91de954748dffdc47819c47668751af13048618763 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTkyOjNCMTk5ODoyMTk4NDIyOjJENjIxQTE6NkE1OUE0ODkiLCJ2aXNpdG9yX2lkIjoiMTU5OTY4MDEwMDM5NTc1NDYzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 84385859493e4217a804fd44327a2ac45629408948fc67cb2bffea085d719f9b |
| hovercard-subject-tag | issue:283313730 |
| 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/5717/issue_layout |
| twitter:image | https://opengraph.githubassets.com/24f41528b2f92d230bc8a982679ad896a8fe1c0e188e975247ffb1f3153b3638/PowerShell/PowerShell/issues/5717 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/24f41528b2f92d230bc8a982679ad896a8fe1c0e188e975247ffb1f3153b3638/PowerShell/PowerShell/issues/5717 |
| og:image:alt | Steps to reproduce Test-Path ' ' Expected behavior NB: Because the .Net Core method Directory.Exists states in the docs here that trailing whitespaces are removed, the expectation of the last 2 spa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bergmeister |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| 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 | 0b971869dd75eec26500a9de7e85b8137c6bf0f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width