MergePSCustomObject

0.2.1

Apteco PS Modules - PowerShell merge PSCustomObject

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

Just use

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

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

Just use

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

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

Merge-PSCustomObject -Left $left -right $right -AddPropertiesFromRight -MergeArrays -MergePSCustomObjects -MergeHashtables

```

to merge two nested PSCustomObjects 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 MergePSCustomObject

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

Install-PSResource -Name MergePSCustomObject

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-PSCustomObject

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes


0.2.1 Removed the hard RequiredModules dependency on MergeHashtable -- it is only needed for the
     -MergeHashtables recursion feature, so it is now a soft dependency checked lazily at call time
     instead, matching how MergeHashtable already treats its own dependency on this module. Neither
     module forces the other to be installed unless you actually use the cross-type recursion flag
0.2.0 New release to 0.2.0 after it is now integrated into AptecoPSFramework module
0.1.2 Updated the copyright year to 2025
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.3 Bumped the copyright year to 2024
0.0.2 Add dependency for MergeHashtable module
0.0.1 Initial release of merge pscustomobject module through psgallery

FileList

Version History

Version Downloads Last updated
0.2.1 (current version) 5 7/22/2026
0.2.0 4 7/22/2026
0.1.2 88 9/23/2025
0.1.1 11 9/9/2025
0.1.0 27 3/18/2025
0.0.3 45 6/24/2024
0.0.2 83 8/18/2023
0.0.1 10 8/18/2023
Show more