I'm little confused about how PowerShell handles the format of the objects when they displayed with Write-Host vs. Write-Output vs. directly calling the object.
I need to use Write-Host, because Write-Output breaks my code when I call it in functions.
But when I used Write-Host, displayed data is not what I expected. I wanted to see my object like in when I directly called it (Write-Host is also the same).
PS> $files = GetChildItem C:\
PS> $files # Or Write-Output $files
PS> Write-Host $files
PS> Write-Host $files |Format-Table
PS> $files | Format-Table | Write-Host