Search notes:

PowerShell: common parameter -informationVariable

The common parameter -informationVariable is used in combination with the write-information cmdlet and specifies the name of a variable into which the written messages are accumulated.
The type of the variable is System.Collections.ArrayList.
function do-x {
  [cmdletBinding()] param()

   write-information "do-x was called"
}

function do-y {
  [cmdletBinding()] param()

   write-information "do-y was called"
   do-x
}

do-y -informationAction continue -informationVariable informationGathered

"Type of `$informationGathered: $($informationGathered.GetType().Fullname)"
foreach ($info in $informationGathered) {
   "Info: $info"
}
Github repository about-PowerShell, path: /language/cmdlet/parameter/common/informationVariable.ps1

Index