René's URL Explorer Experiment


Title: Is there a good reason not to allow direct access to properties whose name starts with a digit? · Issue #6946 · PowerShell/PowerShell · GitHub

Open Graph Title: Is there a good reason not to allow direct access to properties whose name starts with a digit? · Issue #6946 · PowerShell/PowerShell

X Title: Is there a good reason not to allow direct access to properties whose name starts with a digit? · Issue #6946 · PowerShell/PowerShell

Description: Currently, you cannot access an object's property if that property's name happens to start with a (decimal) digit: $obj = [pscustomobject] @{ '1a' = '1a''s value' } # !! BREAKS, because the property name starts with a digit. $obj.1a Note...

Open Graph Description: Currently, you cannot access an object's property if that property's name happens to start with a (decimal) digit: $obj = [pscustomobject] @{ '1a' = '1a''s value' } # !! BREAKS, because the propert...

X Description: Currently, you cannot access an object's property if that property's name happens to start with a (decimal) digit: $obj = [pscustomobject] @{ '1a' = '1a''s value' } ...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/6946

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Is there a good reason not to allow direct access to properties whose name starts with a digit?","articleBody":"Currently, you cannot access an object's property if that property's name happens to start with a (decimal) _digit_:\r\n\r\n```powershell\r\n$obj = [pscustomobject] @{ '1a' = '1a''s value' }\r\n \r\n # !! BREAKS, because the property name starts with a digit.\r\n$obj.1a\r\n```\r\n\r\nNote: It does work with an _all-digit name_, such as `111`, as explained below.\r\n\r\nThe error message you get is:\r\n\r\n```none\r\n...\r\nMissing property name after reference operator.\r\n...\r\n```\r\n\r\nThe current _workarounds_ are to either use _quoting_ or to _indirectly_ reference the property via a _variable_ containing the name:\r\n\r\n```powershell\r\n# OK: Quote the property name\r\n$obj.'1a'\r\n$obj.\"1a\"\r\n\r\n# OK: Access the property via  a *variable*\r\n$propName = '1a'\r\n$obj.$propName\r\n```\r\n\r\n\u003csup>Note: `$obj.{1a}`, as mentioned by @george-chakhidze below, happens to work too, but it is  an accidental by-product of script-block stringification.\r\n\u003c/sup>\r\n\r\n\r\nIs there a good reason _not_ to allow direct use of the literal property name?\r\nIn other words: why shouldn't `$obj.1a` work as-is?\r\n\r\n(By contrast, there are property names that do invariably require quoting, such as\r\n `([pscustomobject] @{ 'a.b' = 'a.b''s value' }).'a.b'`)\r\n\r\nEnvironment data\r\n----------------\r\n\r\nWritten as of:\r\n\r\n```powershell\r\nPowerShell Core v6.1.0-preview.2\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2018-05-27T23:30:50Z","url":"https://github.com/PowerShell/PowerShell/issues/6946"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:604054e6-0708-d18f-c1a3-c33e275dbc10
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8578:2BF055:ED86D3:154A5F5:6AFDA8C3
html-safe-noncefd42d7447dbea22a4274b81bb61644f25f5125a9eaa5765c02b5f389c74a2082
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTc4OjJCRjA1NTpFRDg2RDM6MTU0QTVGNTo2QUZEQThDMyIsInZpc2l0b3JfaWQiOiIxNjY3NzA2NTAyNTY0OTE1Mzk1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca60c8d191bd9c2e5d63fd4efe9ab75e58131d75b278e2edd123e44a6d89db13c
hovercard-subject-tagissue:326860869
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/6946/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e73801b39a9e0dab067a9b2fd322495b70ed10a3d0e9a2c8296bff06e2e3c671/PowerShell/PowerShell/issues/6946
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e73801b39a9e0dab067a9b2fd322495b70ed10a3d0e9a2c8296bff06e2e3c671/PowerShell/PowerShell/issues/6946
og:image:altCurrently, you cannot access an object's property if that property's name happens to start with a (decimal) digit: $obj = [pscustomobject] @{ '1a' = '1a''s value' } # !! BREAKS, because the propert...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemklement0
hostnamegithub.com
expected-hostnamegithub.com
Nonebc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0ddf53eb35c87f1f8df13dbf75c3bdadbfc6e969
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/6946#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F6946
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F6946
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/6946
Reloadhttps://github.com/PowerShell/PowerShell/issues/6946
Reloadhttps://github.com/PowerShell/PowerShell/issues/6946
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests366 (366)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/6946
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/6946
Is there a good reason not to allow direct access to properties whose name starts with a digit?https://github.com/PowerShell/PowerShell/issues/6946#top
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on May 27, 2018https://github.com/PowerShell/PowerShell/issues/6946#issue-326860869
Ilya (iSazonov)https://github.com/iSazonov
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
on May 28, 2018https://github.com/PowerShell/PowerShell/issues/6946#event-1649744829
https://github.com/BrucePay
Bruce Payette (BrucePay)https://github.com/BrucePay
on May 28, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-392601336
Michael Klement (@mklement0)https://github.com/mklement0
StackOverflow questionhttps://stackoverflow.com/questions/50556895/powershell-properties-issues
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on May 28, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-392603254
Bruce Payette (@BrucePay)https://github.com/BrucePay
https://github.com/BrucePay
Bruce Payette (BrucePay)https://github.com/BrucePay
on May 28, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-392609833
Michael Klement (@mklement0)https://github.com/mklement0
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on May 28, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-392612626
Bruce Payette (@BrucePay)https://github.com/BrucePay
https://github.com/BrucePay
Bruce Payette (BrucePay)https://github.com/BrucePay
on May 29, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-392633220
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on May 29, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-392641793
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on May 30, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-393229556
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on May 30, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-393285797
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
Bruce Payette (@BrucePay)https://github.com/BrucePay
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on May 30, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-393288016
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on May 30, 2018https://github.com/PowerShell/PowerShell/issues/6946#issuecomment-393321086
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
#6959https://github.com/PowerShell/PowerShell/issues/6959
Michael Klement (mklement0)https://github.com/mklement0
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 30, 2018https://github.com/PowerShell/PowerShell/issues/6946#event-1654613718
Ilya (iSazonov)https://github.com/iSazonov
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
on Jun 7, 2018https://github.com/PowerShell/PowerShell/issues/6946#event-1668250105
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/6946
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/6946
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.