After your Select -ExpandProperty, what you’ve got is a string object. $OU will contain the string. By piping $OU to “Select *,” you’re asking the shell to display the properties of $OU, rather than its contents - and Length is the only property of a String object.
You can’t “convert from an object to a string;” a String is a kind of object. But by using -ExpandProperty you’ve already converted from an ADComputer object to just a string.
I ask because if $out is just a string, piping it to ConvertTo-EnhancedHTML fragment won’t do anything. I’m a bit confused as to what I’m dealing with as this doesn’t seem to be a follow-on to your question about the string object.
Also, both the back-ticks and the semicolons are unnecessary in the hash tables you’re constructing. Just so you’re aware.
I would start by just piping it to ConvertTo-HTML, to see what it does.
$out | ConvertTo-HTML -Fragment
That’s the native PowerShell command, and it’s what ConvertTo-EnhancedHTMLFragment uses under the hood. If that works, then you can try switching back to enhanced and adding parameters one at a time to get what you’re after.