How to output to CSV file only with the offline PC hostnames and PC owners and PC status showing as failed on 3 columns on CSV file?

I tried the code below, it shows all the list for UP and Down PCs and showing Unknown for all the PC owners.
Host PC Owner PC Status
PC1 Unknown UP
PC2 Unknown UP
PC3 Unknown Down
PC4 Unknown Down
Also, it seems it's not getting the PC owner from AD., kindly note, I manually input the hostnames only of the PC on a text file and saved it on C drive. What do I need to change on the code? If for example, on a text file I input the hostnames with PC owner like this "PC1 - Shaider007" and I only want the result to show only for all the Down PCs, I don't need to get the PCs that are UP. So basically, on a text file, I will type the hostname together with the PC name then it will reflect on the result but only will show the failed ones. The reason why I only want to type the hostnames with PC owner as if it checks from AD maybe the code will run for too long as we have PCs in other countries, I am not sure if my thinking is correct.
But if only typing the hostnames on a text file will work fine and the code will help to check the PC owner from AD then it will only show the result for DOWN PCs then it should be ok. Please kindly advise. Thanks
Hostname PC Owner Status
PC1 Shaider007 Down
PC2 Rich Matheisen Down
PC3 Bogart Down
PC4 Poppeye Down
PC5 VoltesV Down
Below is the Powershell code.
Get-Content "C:\PowerShell\Hostnames.txt" |
ForEach-Object{
try{
$owner = Get-ADUser ((Get-ADComputer $_ -properties managedBy -ErrorAction STOP).managedBy)
$owner = $owner.sAMAccountname
}
Catch{
$owner = "Unknown"
}
if (Test-Connection -ComputerName $_ -Count 1 -Quiet -ErrorAction SilentlyContinue) {
Write-Host "$_ is up, owner is $owner" -ForegroundColor Green -BackgroundColor Blue
[PSCustomObject]@{
Host = $_
'PC Owner' = $owner
'PC Status' = 'UP'
}
}
else {
Write-Host "$_ is down, owner is $owner" -ForegroundColor Red -BackgroundColor Yellow
[PSCustomObject]@{
Host = $_
'PC Owner' = $owner
'PC Status' = 'DOWN'
}
}
} | Export-Csv "C:\PowerShell\Result.csv" -NoTypeInformation