René's URL Explorer Experiment


Title: Classes inheriting from [System.Attribute] cannot be defined and used in the same PowerShell module · Issue #1762 · PowerShell/PowerShell · GitHub

Open Graph Title: Classes inheriting from [System.Attribute] cannot be defined and used in the same PowerShell module · Issue #1762 · PowerShell/PowerShell

X Title: Classes inheriting from [System.Attribute] cannot be defined and used in the same PowerShell module · Issue #1762 · PowerShell/PowerShell

Description: Steps to reproduce set-StrictMode -Version 'Latest' $PSDefaultParameterValues['*:ErrorAction'] = 'Stop' class TestAttribute : System.Attribute { } class TestClass { [int] [TestAttribute()] $i = 5 } S C:\Users\scbaker> Import-Module E:\tm...

Open Graph Description: Steps to reproduce set-StrictMode -Version 'Latest' $PSDefaultParameterValues['*:ErrorAction'] = 'Stop' class TestAttribute : System.Attribute { } class TestClass { [int] [TestAttribute()] $i = 5 }...

X Description: Steps to reproduce set-StrictMode -Version 'Latest' $PSDefaultParameterValues['*:ErrorAction'] = 'Stop' class TestAttribute : System.Attribute { } class TestClass { [int] [T...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Classes inheriting from [System.Attribute] cannot be defined and used in the same PowerShell module","articleBody":"## Steps to reproduce\r\n\r\nset-StrictMode -Version 'Latest'\r\n$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'\r\n\r\nclass TestAttribute : System.Attribute {\r\n}\r\nclass TestClass {\r\n[int] [TestAttribute()] $i = 5\r\n}\r\n\r\n S C:\\Users\\scbaker> Import-Module E:\\tmp\\Test-Module2.psm1\r\n\r\nImport-Module : The invoked member is not supported before the type is created.\r\nAt line:1 char:1\r\n- Import-Module E:\\tmp\\Test-Module.psm1\r\n- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n- CategoryInfo : NotSpecified: (:) [Import-Module], NotSupportedException\r\n- FullyQualifiedErrorId : System.NotSupportedException,Microsoft.PowerShell.Commands.ImportModuleCommand\r\n\r\nScotia Baker:\r\n\r\nBecause class names aren't visible outside their defining module, the only workaround I've found is using Add-Type.  Defining the attribute in another module using PS5 class support does not work due to lexical scoping of class names.\r\n\r\nISSUE:\r\n\r\nA custom attribute class cannot be defined and used within the same PowerShell module.\r\n\r\nIMPACT:\r\n\r\n(1) Debug time diagnosing the issue.  The import failure does not say what member or type is involved, making debugging difficult.\r\n\r\n(2) An extra module must be created to define attribute classes regardless of logical code layout.\r\n\r\nThe primary impact is in the debugging time; an extra module may be ugly but it's easy enough.  A fix for the issue is of course preferred.\r\n","author":{"url":"https://github.com/SteveL-MSFT","@type":"Person","name":"SteveL-MSFT"},"datePublished":"2016-08-12T19:47:14Z","url":"https://github.com/PowerShell/PowerShell/issues/1762"}

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:f4b241fe-66fb-ab43-8fc9-f8c3564a5d32
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8230:45051:38D96E:4FA88C:6AFDC4B1
html-safe-nonce8085287d4269d99d49fb7d0a4777e182bae7d5e9222e46ad014a1b51be944f74
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjMwOjQ1MDUxOjM4RDk2RTo0RkE4OEM6NkFGREM0QjEiLCJ2aXNpdG9yX2lkIjoiNjY0MDY2Njc3ODg4MTg2ODk3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac50e9d200d4e855edb1102b99d4d286493994238e143b619caa00eee0cab12c6b
hovercard-subject-tagissue:170945653
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/1762/issue_layout
twitter:imagehttps://opengraph.githubassets.com/92736e5217cd1e7b7b804196ee8274a528ffafbfd1e3eaa4ff45edb61043a659/PowerShell/PowerShell/issues/1762
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/92736e5217cd1e7b7b804196ee8274a528ffafbfd1e3eaa4ff45edb61043a659/PowerShell/PowerShell/issues/1762
og:image:altSteps to reproduce set-StrictMode -Version 'Latest' $PSDefaultParameterValues['*:ErrorAction'] = 'Stop' class TestAttribute : System.Attribute { } class TestClass { [int] [TestAttribute()] $i = 5 }...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSteveL-MSFT
hostnamegithub.com
expected-hostnamegithub.com
None9ab00cc3b4fa90bbd3da70765dd38efc23cfa9d9b0930e41feea2bf67f60ecaf
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
release1b795ba060b92691fc16c5a12cf2bf95e83432b4
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/1762#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F1762
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%2F1762
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/1762
Reloadhttps://github.com/PowerShell/PowerShell/issues/1762
Reloadhttps://github.com/PowerShell/PowerShell/issues/1762
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/1762
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/1762
Classes inheriting from [System.Attribute] cannot be defined and used in the same PowerShell modulehttps://github.com/PowerShell/PowerShell/issues/1762#top
KeepOpenThe bot will ignore these and not auto-closehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22KeepOpen%22
Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Up-for-Grabs%22
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Aug 12, 2016https://github.com/PowerShell/PowerShell/issues/1762#issue-170945653
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
on Aug 12, 2016https://github.com/PowerShell/PowerShell/issues/1762#event-754445258
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Sep 29, 2016https://github.com/PowerShell/PowerShell/issues/1762#event-807592966
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Sep 29, 2016https://github.com/PowerShell/PowerShell/issues/1762#issuecomment-250580812
Jason Shirk (lzybkr)https://github.com/lzybkr
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Up-for-Grabs%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
on Feb 20, 2017https://github.com/PowerShell/PowerShell/issues/1762#event-969707081
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
6.0.0-NiceToHavehttps://github.com/PowerShell/PowerShell/milestone/16
on Feb 9, 2018https://github.com/PowerShell/PowerShell/issues/1762#event-1465818274
https://github.com/wisemoth
wisemothhttps://github.com/wisemoth
on Jan 16, 2019https://github.com/PowerShell/PowerShell/issues/1762#issuecomment-454797864
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Jan 16, 2019https://github.com/PowerShell/PowerShell/issues/1762#issuecomment-454804454
https://github.com/vexx32/PSKoans/blob/eac7d8250dfe49e85e12b7432ad687dcf5470f78/PSKoans/PSKoans.psm1#L16-L26https://github.com/vexx32/PSKoans/blob/eac7d8250dfe49e85e12b7432ad687dcf5470f78/PSKoans/PSKoans.psm1#L16-L26
https://github.com/vexx32/PSWordCloud/blob/55723befc757eae27fb20dfb7dd273360c150655/PSWordCloud/Public/New-WordCloud.ps1#L7-L58https://github.com/vexx32/PSWordCloud/blob/55723befc757eae27fb20dfb7dd273360c150655/PSWordCloud/Public/New-WordCloud.ps1#L7-L58
https://github.com/vexx32/PSWordCloud/blob/55723befc757eae27fb20dfb7dd273360c150655/PSWordCloud/Public/New-WordCloud.ps1#L307-L326https://github.com/vexx32/PSWordCloud/blob/55723befc757eae27fb20dfb7dd273360c150655/PSWordCloud/Public/New-WordCloud.ps1#L307-L326
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
Jason Shirk (@lzybkr)https://github.com/lzybkr
https://github.com/wisemoth
wisemothhttps://github.com/wisemoth
on Jan 16, 2019https://github.com/PowerShell/PowerShell/issues/1762#issuecomment-454809137
Rain Sallow (/u/ta11ow) (@vexx32)https://github.com/vexx32
https://github.com/vexx32
Rain Sallow (/u/ta11ow) (vexx32)https://github.com/vexx32
on Jan 16, 2019https://github.com/PowerShell/PowerShell/issues/1762#issuecomment-454824749
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/1762#issuecomment-1814197108
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/1762#issuecomment-1814197112
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/1762#event-10978925215
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/1762#issuecomment-1814201911
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 23, 2023https://github.com/PowerShell/PowerShell/issues/1762#issuecomment-1824507165
Microsoft GitHub Policy Servicehttps://aka.ms/1es-gitops
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/1762#event-11048220006
Staffan Gustafsson (powercode)https://github.com/powercode
KeepOpenThe bot will ignore these and not auto-closehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22KeepOpen%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
on Nov 5, 2025https://github.com/PowerShell/PowerShell/issues/1762#event-20724660833
Staffan Gustafsson (powercode)https://github.com/powercode
on Nov 5, 2025https://github.com/PowerShell/PowerShell/issues/1762#event-20724673692
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/1762
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/1762
KeepOpenThe bot will ignore these and not auto-closehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22KeepOpen%22
Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Up-for-Grabs%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.