Search notes:

PowerShell: the preference variable $formatEnumerationLimit

Create an array of psCustomObject's. Each of these object has a property named txt and a property named elems. elems is also an array with a varying number of elements:
$objects =
   [psCustomObject] @{
      txt   = 'three'
      elems = 'A', 'B', 'C'
   },
   [psCustomObject] @{
      txt   = 'four'
      elems = 'D', 'E', 'F', 'G'
   },
   [psCustomObject] @{
      txt   = 'five'
      elems = 'H', 'I', 'J', 'K', 'L'
   },
   [psCustomObject] @{
      txt   = 'six'
      elems = 'M', 'N', 'O', 'P', 'Q', 'R'
   },
   [psCustomObject] @{
      txt   = 'seven'
      elems = 'S', 'T', 'U', 'V', 'W', 'X', 'Y'
   }

Github repository about-PowerShell, path: /language/variable/preference/formatEnumerationLimit/objects.ps1
By default, the value of the preference variable $formatEnumerationLimit is set to 4, thus, PowerShell will write («unnest») up to the first 4 elements of elems:
$formatEnumerationLimit = 4 # Default
$objects | select-object txt, elems
#
#  txt   elems
#  ---   -----
#  three {A, B, C}
#  four  {D, E, F, G}
#  five  {H, I, J, K...}
#  six   {M, N, O, P...}
#  seven {S, T, U, V...}
Github repository about-PowerShell, path: /language/variable/preference/formatEnumerationLimit/4.ps1
When $formatEnumerationLimit is increased to 6, PowerShell will accordingly display up to the first six elements of an array:
$formatEnumerationLimit = 6
$objects | select-object txt, elems
#
#  txt   elems
#  ---   -----
#  three {A, B, C}
#  four  {D, E, F, G}
#  five  {H, I, J, K, L}
#  six   {M, N, O, P, Q, R}
#  seven {S, T, U, V, W, X...}
Github repository about-PowerShell, path: /language/variable/preference/formatEnumerationLimit/6.ps1

Index