I'm trying to get the following variable and text on one line in the output file but the result is two lines. $Computer[0] is a column in a datatable "filled" from a SQL query. Please advise.
Write-Output $Computer[0]" : Server Name" | Out-File $ReportFile -Append
result two lines
------------
Write-Output $Computer[0]+ " : Server Name" | Out-File $ReportFile -Append
result the "+" character appears in the output file as well
------------
Write-Output "$Computer[0] : Server Name" | Out-File $ReportFile -Append
result System.Data.DataRow[0] : Server Name
Write-Output $Computer[0]" : Server Name" | Out-File $ReportFile -Append
result two lines
------------
Write-Output $Computer[0]+ " : Server Name" | Out-File $ReportFile -Append
result the "+" character appears in the output file as well
------------
Write-Output "$Computer[0] : Server Name" | Out-File $ReportFile -Append
result System.Data.DataRow[0] : Server Name