Title: `test-path $null` throws error · Issue #24468 · PowerShell/PowerShell · GitHub
Open Graph Title: `test-path $null` throws error · Issue #24468 · PowerShell/PowerShell
X Title: `test-path $null` throws error · Issue #24468 · 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/24468
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`test-path $null` throws error","articleBody":"### Prerequisites\n\n- [X] Write a descriptive title.\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [X] Search the existing issues.\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\n```powershell\r\ntest-path $null\r\n```\n\n### Expected behavior\n\n```console\n$false\n```\n\n\n### Actual behavior\n\n```console\nTest-Path: Value cannot be null. (Parameter 'The provided Path argument was null or an empty collection.')\n```\n\n\n### Error details\n\n```console\nException :\r\n Type : System.ArgumentNullException\r\n Message : Value cannot be null. (Parameter 'The provided Path argument was null or an empty collection.')\r\n ParamName : The provided Path argument was null or an empty collection.\r\n HResult : -2147467261\r\nCategoryInfo : InvalidArgument: (:) [Test-Path], ArgumentNullException\r\nFullyQualifiedErrorId : NullPathNotPermitted,Microsoft.PowerShell.Commands.TestPathCommand\r\nInvocationInfo :\r\n MyCommand : Test-Path\r\n ScriptLineNumber : 1\r\n OffsetInLine : 1\r\n HistoryId : 1\r\n Line : test-path $null\r\n Statement : test-path $null\r\n PositionMessage : At line:1 char:1\r\n + test-path $null\r\n + ~~~~~~~~~~~~~~~\r\n InvocationName : test-path\r\n CommandOrigin : Internal\r\nScriptStackTrace : at \u003cScriptBlock\u003e, \u003cNo file\u003e: line 1\r\nPipelineIterationInfo :\r\n 0\r\n 1\n```\n\n\n### Environment data\n\n```powershell\nPSVersion 7.4.5\r\nPSEdition Core\r\nGitCommitId 7.4.5\r\nOS Microsoft Windows 10.0.27729\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\n```\n\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/rkitover","@type":"Person","name":"rkitover"},"datePublished":"2024-10-20T16:51:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/24468/PowerShell/issues/24468"}
| 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:126edffb-b6c2-700d-629a-492de286942c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C572:1DE205:27D70B:38CEFC:6A59D78D |
| html-safe-nonce | c17c8152690fac32a32937b5a6ccec59446d69794fb59196ecaf93d3c0f52f4b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTcyOjFERTIwNToyN0Q3MEI6MzhDRUZDOjZBNTlENzhEIiwidmlzaXRvcl9pZCI6IjE2ODY3NDM5MDIxNDQwMjY1MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 194675fbeeb037c88374860b5725fbb11d4cb80a2722dd18c6e43595102e24cd |
| hovercard-subject-tag | issue:2600647253 |
| 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/24468/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86bfcdb15cd85f68875581488441486a2861cf28b1da9143eafbfab47cf875c3/PowerShell/PowerShell/issues/24468 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86bfcdb15cd85f68875581488441486a2861cf28b1da9143eafbfab47cf875c3/PowerShell/PowerShell/issues/24468 |
| 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 | rkitover |
| hostname | github.com |
| expected-hostname | github.com |
| None | ba3976babb66479b1c943a8edc0777d96157da48fadc0161f9ddb219deee8353 |
| 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 | bfacf98c3b7ad151665d6ddd216469389872b251 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width