File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Gets Language Functions by Input Type
4+ . DESCRIPTION
5+ Returns a dictionary of all unique language functions that accept a pipeline parameter.
6+
7+ The key will be the type of parameter accepted.
8+ The value will be a list of commands that accept that parameter from the pipeline.
9+ . NOTES
10+ Primitive parameter types and string types will be ignored.
11+ #>
12+ param ()
13+ # We want the results to be ordered (both the keys and the values)
14+ $byInputType = [Ordered ]@ {}
15+ $uniqueList = @ ($this.Unique | Sort-Object Order)
16+ foreach ($uniqueCommand in $uniqueList ) {
17+ , @ (foreach ($parameterSet in $uniqueCommand.ParameterSets ) {
18+ foreach ($parameterInSet in $parameterSet.Parameters ) {
19+ if (-not $parameterInSet.ValueFromPipeline ) { continue }
20+ if ($parameterInSet.ParameterType.IsPrimitive ) { continue }
21+ if ($parameterInSet.ParameterType -eq [string ]) { continue }
22+ if (-not $byInputType [$parameterInSet.ParameterType ]) {
23+ $byInputType [$parameterInSet.ParameterType ] = [Collections.Generic.List [PSObject ]]::new()
24+ }
25+ $byInputType [$parameterInSet.ParameterType ].Add($uniqueCommand )
26+ }
27+ })
28+ }
29+ $byInputType
Original file line number Diff line number Diff line change 1+ <#
2+ . SYNOPSIS
3+ Gets Language Templates by Input Type
4+ . DESCRIPTION
5+ Returns a dictionary of all unique language templates that accept a pipeline parameter.
6+
7+ The key will be the type of parameter accepted.
8+ The value will be a list of commands that accept that parameter from the pipeline.
9+ . NOTES
10+ Primitive parameter types and string types will be ignored.
11+ #>
12+ param ()
13+ # We want the results to be ordered (both the keys and the values)
14+ $byInputType = [Ordered ]@ {}
15+ $uniqueList = @ ($this.Unique | Sort-Object Order)
16+ foreach ($uniqueCommand in $uniqueList ) {
17+ , @ (foreach ($parameterSet in $uniqueCommand.ParameterSets ) {
18+ foreach ($parameterInSet in $parameterSet.Parameters ) {
19+ if (-not $parameterInSet.ValueFromPipeline ) { continue }
20+ if ($parameterInSet.ParameterType.IsPrimitive ) { continue }
21+ if ($parameterInSet.ParameterType -eq [string ]) { continue }
22+ if (-not $byInputType [$parameterInSet.ParameterType ]) {
23+ $byInputType [$parameterInSet.ParameterType ] = [Collections.Generic.List [PSObject ]]::new()
24+ }
25+ $byInputType [$parameterInSet.ParameterType ].Add($uniqueCommand )
26+ }
27+ })
28+ }
29+ $byInputType
You can’t perform that action at this time.
0 commit comments