Combines dictionaries together into a single dictionary.
Join-Keys.ps1 [[-ReferenceObject] <IDictionary>] [-InputObject] <IDictionary> [-Accumulate] [-Force]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Join-Keys.ps1 @{a=1;b=2} @{b=0;c=3}
Name Value —- —– b 2 c 3 a 1
@{b=0;c=3},@{c=4;d=5} |Join-Keys.ps1 @{a=1;b=2} -Force |foreach {$_ |ConvertTo-Json -Compress}
{“c”:3,”b”:0,”a”:1} {“d”:5,”b”:2,”c”:4,”a”:1}
@{b=0;c=3},@{c=4;d=5} |Join-Keys.ps1 @{a=1;b=2} -Force -Accumulate |foreach {$_ |ConvertTo-Json -Compress}
{“c”:3,”b”:0,”a”:1} {“c”:4,”b”:0,”d”:5,”a”:1}
@{b=0;c=3},@{c=4;d=5} |Join-Keys.ps1 -Accumulate |select -Last 1
Name Value —- —– c 3 b 0 d 5
Initial dictionary value to combine.
Type: IDictionary
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: @{}
Accept pipeline input: False
Accept wildcard characters: False
Hashtables or other dictionaries to combine.
Type: IDictionary
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Indicates that the ReferenceObject should be updated with each input dictionary, rather than the default behavior of combining the original ReferenceObject with each.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
For matching keys, overwrites old values with new ones. By default, only new keys are added.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
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.