If you give your variables identifiable names you could do something like this.
cls
$object1 = "aaaa"
$object2 = $null
$object3 = "cccc"
$object4 = $null
$result = @()
Get-Variable -Name 'object*' | foreach { # get our objects
if ($_.Value) {
"Appending {0}" -f $_.name
$result += $_.Value # append this object to the result
}
}
""
"Result is type {0} with a count of {1}" -f $Result.GetType().BaseType, $Result.count
""
$Result