PowerShell starts to expand variables inside double quotes from left to right. So it will expand $Computer first before it comes to the period. If you want to expand particular properties you have to use a subexpression like this:
$computer = Get-ADComputer -Identity 'ComputerName'
"This way you get what you want: $($computer.Name)"
BTW: When you post code or console output or error messages please format it as code using the preformatted text button ( </> ). Simply place the cursor on an empty line, click the button and paste your code.
Thank you for the explanation. I had not realized that the eval would stop at the “.”
I figured the object name + . + variable was one unit. The Microsoft doc is not clear on this. The ss64 illustration is much better.
Thanks.