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.

Stars225
Forks39
Open issues2
PowerShell Gallery downloads666617
Releasev0.0.312
Language: PowerShell Updated: 2026-04-11T10:18:52.0000000+00:00

Curated Examples

Flatten nested objects

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

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