René's URL Explorer Experiment


Title: When powershell class method has same name as property, the property disapear and is not accessible from any instance · Issue #7736 · PowerShell/PowerShell · GitHub

Open Graph Title: When powershell class method has same name as property, the property disapear and is not accessible from any instance · Issue #7736 · PowerShell/PowerShell

X Title: When powershell class method has same name as property, the property disapear and is not accessible from any instance · Issue #7736 · PowerShell/PowerShell

Description: Hi, When I have a powershell class, that has a method with the same name as one of it's properties, then the property disapear, and is not visible on any of the instances. See examples below. Steps to reproduce Class Folder { $Name $Path...

Open Graph Description: Hi, When I have a powershell class, that has a method with the same name as one of it's properties, then the property disapear, and is not visible on any of the instances. See examples below. Steps...

X Description: Hi, When I have a powershell class, that has a method with the same name as one of it's properties, then the property disapear, and is not visible on any of the instances. See examples below. S...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"When powershell class method has same name as property, the property disapear and is not accessible from any instance","articleBody":"\u003c!--\r\n\r\nFor Windows PowerShell 5.1 issues, suggestions, or feature requests please use the following link instead:\r\n- Windows PowerShell [UserVoice](https://windowsserver.uservoice.com/forums/301869-powershell)\r\n\r\nIf it is a bug report:\r\n- make sure you are able to repro it on the latest released version. \r\nYou can install the latest version from https://github.com/PowerShell/PowerShell/releases\r\n- Search the existing issues.\r\n- Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- Refer to the [known issues](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6).\r\n- Fill out the following repro template:\r\n\r\nIf it's not a bug, please remove the template and elaborate the issue in your own words.\r\n-->\r\n\r\nHi,\r\n\r\nWhen I have a powershell class, that has a method with the same name as one of it's properties, then the property disapear, and is not visible on any of the instances. \r\n\r\nSee examples below.\r\n\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\n\r\nClass Folder {\r\n    \r\n    $Name\r\n    $Path\r\n    [bool]$IsPresent\r\n\r\n    [string]IsPresent(){\r\n        \r\n        return \"woop\"\r\n    }\r\n}\r\n\r\n\r\n```\r\n\r\nWhen looking using Get-Member, we can see that the property $IsPresent disapeared, but that method is still there:\r\n\r\n```powershell\r\n[Folder]::New() | gm\r\n\r\n\r\n   TypeName: Folder\r\n\r\nName        MemberType Definition                    \r\n----        ---------- ----------                    \r\nEquals      Method     bool Equals(System.Object obj)\r\nGetHashCode Method     int GetHashCode()             \r\nGetType     Method     type GetType()                \r\nIsPresent   Method     string IsPresent()            \r\nToString    Method     string ToString()             \r\nName        Property   System.Object Name {get;set;} \r\nPath        Property   System.Object Path {get;set;\r\n```\r\n\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n\r\n```powershell\r\n\r\n[Folder]::New()\r\n\r\n#Should return\r\n\r\nName Path IsPresent\r\n---- ---- ---------\r\n              False\r\n\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\n```powershell\r\n\r\n[Folder]::New()\r\n\r\n#Returns\r\n\r\nName Path\r\n---- ----\r\n\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n\r\nI had the same behaviour on:\r\n\r\n```powershell\r\n> $PSVersionTable\r\nName                           Value\r\n----                           -----\r\nPSVersion                      6.1.0-preview.1\r\nPSEdition                      Core\r\nGitCommitId                    v6.1.0-preview.1\r\nOS                             Microsoft Windows 10.0.14393\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\nand\r\n\r\n```powershell\r\n\r\nName                           Value                                                                                            \r\n----                           -----                                                                                            \r\nPSVersion                      5.1.14393.2339                                                                                   \r\nPSEdition                      Desktop                                                                                          \r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                          \r\nBuildVersion                   10.0.14393.2339                                                                                  \r\nCLRVersion                     4.0.30319.42000                                                                                  \r\nWSManStackVersion              3.0                                                                                              \r\nPSRemotingProtocolVersion      2.3                                                                                              \r\nSerializationVersion           1.1.0.1                                                                                          \r\n\r\n```\r\n\r\nOn Windows 10 and Windows Server 2012 R2\r\n\r\nWorkaround\r\n---------------\r\n\r\nThe workaround would be to change the name of the method and ensure it is not identical to the property anymore:\r\n\r\n```powershell\r\n\r\nClass Folder {\r\n    \r\n    $Name\r\n    $Path\r\n    [bool]$IsPresent\r\n\r\n    [string]TestIsPresent(){\r\n        \r\n        return \"woop\"\r\n    }\r\n}\r\n\r\n\r\n```\r\n","author":{"url":"https://github.com/Stephanevg","@type":"Person","name":"Stephanevg"},"datePublished":"2018-09-07T16:08:44Z","url":"https://github.com/PowerShell/PowerShell/issues/7736"}

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:6937d5a9-d145-237f-13b5-e3e2d3e38b91
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB470:96CB:5B4D9E:8449FA:6AFDD317
html-safe-nonced9e36b93aa464cf7e583d8907f865698bdd69000324d26259ff74de059f9a901
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDcwOjk2Q0I6NUI0RDlFOjg0NDlGQTo2QUZERDMxNyIsInZpc2l0b3JfaWQiOiIxMTM5NDQ4ODg1NDg0MDQ5MTc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3c5e9dfe4393c24c9f839d7ad818bcab481a004d51a644975ab52526191ba49d
hovercard-subject-tagissue:358127305
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/7736/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bac30f5f16b64ae0bf816fcf439c9182276feba66736254f322f898eefeff683/PowerShell/PowerShell/issues/7736
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bac30f5f16b64ae0bf816fcf439c9182276feba66736254f322f898eefeff683/PowerShell/PowerShell/issues/7736
og:image:altHi, When I have a powershell class, that has a method with the same name as one of it's properties, then the property disapear, and is not visible on any of the instances. See examples below. Steps...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameStephanevg
hostnamegithub.com
expected-hostnamegithub.com
None9918bd4004419458bcd838065ac2a76b76ebd11705d73909fff5ab99e996fa23
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
releasea231c174493a6a442c0b0544475c918b30128208
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/7736#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F7736
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%2F7736
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/7736
Reloadhttps://github.com/PowerShell/PowerShell/issues/7736
Reloadhttps://github.com/PowerShell/PowerShell/issues/7736
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/7736
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/7736
When powershell class method has same name as property, the property disapear and is not accessible from any instancehttps://github.com/PowerShell/PowerShell/issues/7736#top
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
Resolution-No ActivityIssue has had no activity for 6 months or morehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-No%20Activity%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
https://github.com/Stephanevg
Stéphane (Stephanevg)https://github.com/Stephanevg
on Sep 7, 2018https://github.com/PowerShell/PowerShell/issues/7736#issue-358127305
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Sep 7, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-419490021
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Sep 10, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-419795282
Stéphane (@Stephanevg)https://github.com/Stephanevg
https://github.com/Stephanevg
Stéphane (Stephanevg)https://github.com/Stephanevg
on Sep 10, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-419974375
Ilya (@iSazonov)https://github.com/iSazonov
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Sep 10, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-420002516
Stéphane (@Stephanevg)https://github.com/Stephanevg
Ilya (iSazonov)https://github.com/iSazonov
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
on Sep 10, 2018https://github.com/PowerShell/PowerShell/issues/7736#event-1836657640
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Sep 10, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-420004694
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Sep 11, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-420145714
Rob Holt (@rjmholt)https://github.com/rjmholt
https://github.com/rjmholt
Rob Holt (rjmholt)https://github.com/rjmholt
on Sep 11, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-420316046
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
https://github.com/rjmholt
Rob Holt (rjmholt)https://github.com/rjmholt
on Sep 11, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-420316384
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Sep 11, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-420318333
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Sep 11, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-420447750
https://github.com/Stephanevg
Stéphane (Stephanevg)https://github.com/Stephanevg
on Sep 21, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-423642522
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Sep 21, 2018https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-423643629
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Futurehttps://github.com/PowerShell/PowerShell/milestone/48
on Sep 21, 2018https://github.com/PowerShell/PowerShell/issues/7736#event-1861187476
https://github.com/apps/microsoft-github-policy-service
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
on Nov 16, 2023https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-1813890672
Microsoft GitHub Policy Servicehttps://aka.ms/1es-gitops
https://github.com/apps/microsoft-github-policy-service
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
on Nov 16, 2023https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-1813890673
Microsoft GitHub Policy Servicehttps://aka.ms/1es-gitops
https://github.com/apps/microsoft-github-policy-service
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
on Nov 16, 2023https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-1813890676
Microsoft GitHub Policy Servicehttps://aka.ms/1es-gitops
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
Resolution-No ActivityIssue has had no activity for 6 months or morehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-No%20Activity%22
on Nov 16, 2023https://github.com/PowerShell/PowerShell/issues/7736#event-10976537376
https://github.com/apps/microsoft-github-policy-service
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
on Nov 23, 2023https://github.com/PowerShell/PowerShell/issues/7736#issuecomment-1824383208
Microsoft GitHub Policy Servicehttps://aka.ms/1es-gitops
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
Futurehttps://github.com/PowerShell/PowerShell/milestone/48
on Nov 23, 2023https://github.com/PowerShell/PowerShell/issues/7736#event-11047369365
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 23, 2023https://github.com/PowerShell/PowerShell/issues/7736#event-11047369410
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/7736
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/7736
Issue-BugIssue has been identified as a bug in the producthttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Bug%22
Resolution-No ActivityIssue has had no activity for 6 months or morehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-No%20Activity%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%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.