# Flatten nested objects

Flatten nested objects on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

PSSharedGoods

PSSharedGoods is little PowerShell Module that primary purpose is to be useful for multiple tasks, unrelated to each other. I've created this module as “a glue” between my other modules.

[View on GitHub](https://github.com/EvotecIT/PSSharedGoods) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSSharedGoods/releases/tag/v0.0.312) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSSharedGoods)

Stars**231**

Forks**40**

Open issues**0**

PowerShell Gallery downloads**670687**

Release**v0.0.313**

Language: PowerShell Updated: 2026-10-30

Curated Examples

Use PSSharedGoods to flatten nested objects before reports or comparisons.

This pattern is useful when an API or configuration object is too nested for a readable table.

It comes from the source example at `Examples/ConvertFlatObject.ps1`.

## When to use this pattern

- You need a table-friendly object shape.
- You want to compare nested configuration snapshots.
- You are preparing data for CSV, HTML, or console output.

## Example

```powershell
Import-Module .\PSSharedGoods.psd1 -Force

$object = [ordered]@{
    Name = 'Example'
    Address = [ordered]@{
        City = 'Warsaw'
        Country = [ordered]@{ Name = 'Poland' }
    }
}

$object | ConvertTo-FlatObject | Format-Table
```

## What this demonstrates

- flattening nested hashtables
- preparing data for exports
- keeping report input predictable

## Source

- [ConvertFlatObject.ps1](https://github.com/EvotecIT/PSSharedGoods/blob/master/Examples/ConvertFlatObject.ps1)

<!-- PowerForge markdown artifact sha256:5C486D1B62BB607E38C1446F6E7628F45D95D8C28AC826889FC1F64DAEACF524 -->
