-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-sdk-docsArea - SDK docsArea - SDK docsissue-doc-ideaIssue - request for new contentIssue - request for new content
Milestone
Description
Prerequisites
- Write a descriptive title.
- Search the existing issues.
Summary of the new feature or changed behavior
Now that PowerShell/PowerShell#12412 was merged, we need to look at adding documentation around the syntax and some general use cases for calling generic methods where PowerShell can't infer the appropriate generic overload based on the argument types.
General syntax is:
# static generic methods
[type_name]::MethodName[generic_type_arguments](method_arguments)
# instance generic methods
$object.MethodName[generic_type_arguments](method_arguments)
# generic_type_arguments can be a a single type, or comma-separated list of types, like `[string, int]`,
# including other generic types like `$obj.MethodName[string, System.Collections.Generic.Dictionary[string, int]]()`
I would expect some of the most common use cases for this would be in using heavily generic types like System.Collections.Concurrent.ConcurrentDictionary and static methods with generic arguments like those found in the System.Linq namespace.
Note that as illustrated in this comment that certain methods may still require type casting their arguments appropriately at the moment.
List of articles that need to be updated
Unsure which articles exactly at the moment.
Link to related PR in PowerShell/PowerShell repo
Link to related Issues in PowerShell/PowerShell repo
Metadata
Metadata
Assignees
Labels
area-sdk-docsArea - SDK docsArea - SDK docsissue-doc-ideaIssue - request for new contentIssue - request for new content