MergeHashtable

0.2.1

Apteco PS Modules - PowerShell merge Hashtable

This module merges two hashtables into one. It is able to handle nested structures like hashtables, arrays and PSCustomObjects. Please see the examples below.

Just use

```PowerShell
$left = [hashtable]@{
   "firstname" = "Florian"
   "lastname" = "Friedrichs"
   "address" = [hashtable]@{
       "Street"
Apteco PS Modules - PowerShell merge Hashtable

This module merges two hashtables into one. It is able to handle nested structures like hashtables, arrays and PSCustomObjects. Please see the examples below.

Just use

```PowerShell
$left = [hashtable]@{
   "firstname" = "Florian"
   "lastname" = "Friedrichs"
   "address" = [hashtable]@{
       "Street" = "Kaiserstraße 35"
   }
   "tags" = [Array]@("nice","company")
   "product" = [PSCustomObject]@{
       "name" = "Orbit"
       "owner" = "Apteco Ltd."
   }
}

$right = [hashtable]@{
   "lastname" = "von Bracht"
   "Street" = "Schaumainkai 87"
   "address" = [hashtable]@{
       "Street" = "Schaumainkai 87"
       "Postcode" = 60596
   }
   "tags" = [Array]@("wow")
   "product" = [PSCustomObject]@{
       "sprint" = 106
   }
}


Merge-Hashtable -Left $left -right $right -AddKeysFromRight -MergeArrays -MergePSCustomObjects -MergeHashtables

```

to merge two nested hashtables into one where the "right" will overwrite existing values from "left".

Show more

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name MergeHashtable

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name MergeHashtable

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Apteco GmbH. All rights reserved.

Package Details

Author(s)

  • florian.von.bracht@apteco.de

Tags

Windows Apteco

Functions

Merge-Hashtable

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes


0.2.1 Fixed the MergePSCustomObject dependency check using Get-InstalledModule, which only knows about
     PowerShellGet-installed modules and misses one that is merely imported into the session (e.g. from
     a local path) -- now uses Get-Module so both cases are recognised
0.2.0 New release to 0.2.0 after it is now integrated into AptecoPSFramework module
     Fixed another bug with Add-Member and .add()
0.1.2 Fixed a bug where merging ArrayList properties with -MergeArrays used Add-Member instead of adding a real
     hashtable key, so the merged key was invisible via indexing/.Keys/ConvertTo-Json on the result
0.1.1 Fixed a problem where values from left were overwritten with empty object from right
0.1.0 First release after running this for a while. Small fix when using [Ordered] in the InputObject
0.0.4 Bumped the copyright year to 2024
0.0.3 Remove dependency for MergePSCustomObject module and add dynamically a message, when it will be needed
0.0.2 Add dependency for MergePSCustomObject module
0.0.1 Initial release of merge hashtable module through psgallery

FileList

Version History

Version Downloads Last updated
0.2.1 (current version) 5 7/22/2026
0.2.0 6 7/22/2026
0.1.1 227 9/9/2025
0.1.0 137 3/18/2025
0.0.4 53 6/24/2024
0.0.3 85 8/18/2023
0.0.2 12 8/18/2023
0.0.1 13 8/18/2023
Show more