-
-
Notifications
You must be signed in to change notification settings - Fork 7
Merge HashTables
apobekiaris edited this page Sep 4, 2020
·
3 revisions
Merge HashTables.
Merge-HashTables [[-Operator] <ScriptBlock>] [<CommonParameters>]
Merge HashTables.
PS C:\> $h1, $h2, $h3 | Merge-Hashtables {($_ | Measure-Object -Average).Average}
Name Value
---- -----
e 1
d 3
b 7
c 5
a 9
Take the average values of three hastables.
PS C:\> $h1, $h2, $h3 | Merge-Hashtables {$_ -Join ""}
Name Value
---- -----
e 1
d 42
b 86
c 753
a 9
Join the values together
PS C:\> $h1, $h2, $h3 | Merge-Hashtables {$_ | Sort-Object}
Name Value
---- -----
e 1
d {2, 4}
b {6, 8}
c {3, 5, 7}
a 9
Sort the values list
{{ Fill Operator Description }}
Type: ScriptBlock
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.