I've created a custom object and tried to print out the object:
$longest_common_entry= New-Object System.Object
$longest_common_entry | Add-Member -type NoteProperty -name s1 -Value $mytext[0]
$longest_common_entry | Add-Member -type NoteProperty -name s2 -Value $mytext[1]
$longest_common_entry | Add-Member -type NoteProperty -name lcs -Value ""
$longest_common_entry | Add-Member -type NoteProperty -name lcs_length -Value 0
Write-Host $longest_common_entry
System.Object
Write-Output $longest_common_entry<BR>
s1 s2 lcs lcs_length
-- -- --- ----------
"Report Technical Design 0.4.docx" "Report Technical Design 0.3.docx" "" 0
Why does write-output displays the object content but not write-host?