Add a new conceptual help topic to cover the ETS (Extended Type System) systematically and comprehensively
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- powershell
- Domain
- documentation
Research direction
Start with the existing about_Types.ps1xml article and the proposed about_Types_Extended topic. Cover the ETS concepts, member definitions and detection, type-name changes, precedence, and .NET interaction described in the issue, then add the new topic to the documentation TOC and link the related article.
Written by the indexing model from the issue text.
Description
Summary of the new document or enhancement
As a user, I want to know:
-
how PowerShell itself decorates .NET types with additional properties (members), both at the type level (as PowerShell does with the built-in type data) and at the instance level (as PowerShell's provider cmdlets do, e.g.
Get-Content).- In addition to adding arbitrary new members, so-called extended members - the engine itself also provides so-called adapted members at the type level, for select types (e.g.,
[xml], WMI/CMI classes, COM classes, and dictionaries (hashtables)). Adapted members surface entities from different object frameworks as if they were regular .NET type members, for simplicity and unified access. (A simple example is the ability to treat the entries of a dictionary as if they were properties; e.g.,@{ foo = 1 }.foo, as an alternative to@{ foo = 1 }['foo'].)
Note that it looks like the AD (Active Directory) provider, as an external module, uses the same technique, but I'm unclear on whether there are public APIs that would allow user code in general to do the same.
- In addition to adding arbitrary new members, so-called extended members - the engine itself also provides so-called adapted members at the type level, for select types (e.g.,
-
how I can define extended members myself (
Update-TypeDatain-session vs.*.types.ps1xmlfiles as part of modules, at the type level;Add-Member/.psobject.Properties.Add()at the instance level) -
that creating
[pscustomobject]instances is also an application of the ETS, namely the construction of an object solely composed of ETS instance members, without any underlying .NET object. -
how I can dynamically add arbitrary ETS type names to objects (instances), for various reasons: to add members to it, to reflect the original type after deserialization (as done by PowerShell itself), to associate an object with formatting data (e.g.,
@{ Name = 'NotReallyAType'; IsPublic=$false; PSTypeName = 'System.RunTimeType' }or
($o = [pscustomobject] @{ foo = 'bar' }).pstypenames.Insert(0, 'CustomType')) -
what type of ETS members I can define and how I can detect ETS members (
Get-TypeDataat the type level,Get-Member -Type AliasProperty, CodeProperty, NoteProperty, ScriptProperty, ScriptMethod, CodeMethod(others?) at both the type and the instance level) -
how precedence is resolved between ETS members and .NET native members of the same name (ETS instance members shadow ETS type members, which in turn shadow native members).
-
that ETS members are PowerShell-specific and aren't visible to .NET methods (but instance members are preserved when they pass through .NET APIs)
about_Types.ps1xml partially covers this, but is primarily focused on creating persistent ETS additions via *.types.ps1xml files.
Details of requested document:
- Proposed title:
about_Types_Extended - Propose location in the TOC:
- Target audience: users
- Purpose or scenario:
or
Proposed changes/additions to existing article: - List of related articles to link to:
about_Types.ps1xml
- Dominant language
- PowerShell
- Stars
- 2.5k
- Forks
- 1.7k
- Avg merge
- 8h 45m
- Merged PRs (30d)
- 33
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MicrosoftDocs/PowerShell-Docs
-
hold-for-pr hold-for-release issue-doc-idea
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MicrosoftDocs/PowerShell-Docs#13195 ·
-
hold-for-pr hold-for-release
Difficulty 1/5 Under an hour Newbie friendliness 88/100
MicrosoftDocs/PowerShell-Docs#12897 ·
-
Add "Avoid function / scriptblock based recursion" section to `Performance Considerations` document Openarea-sdk-docs
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MicrosoftDocs/PowerShell-Docs#11037 · 1 reaction ·
-
issue-doc-idea needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
MicrosoftDocs/PowerShell-Docs#13289 ·
-
hold-for-pr hold-for-release
Difficulty 4/5 3-5 days Newbie friendliness 48/100
MicrosoftDocs/PowerShell-Docs#13172 ·
All issues in MicrosoftDocs/PowerShell-Docs
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·