Hi All
i have the below going out and poking a list of servers to see what OS is installed, all working fine however when i push out to a csv it is not in columns but all held as text in a single column
###############
##Get Servers##
###############
$servers = Get-Content "\\eurorchestrator\c$\servers2.csv"
###########
##Command##
###########
$output = foreach ($server in $servers)
{
$operating = (Get-WmiObject -class Win32_OperatingSystem -computername $server).name
[pscustomobject]@{
'Computername' = "$Server"
'OSVersion' = "$operating"
}
}
#################
##Build Results##
#################
$output |ft computername, osversion -AutoSize | Out-File "\\eurorchestrator\c$\serversResults.csv"
Im After column A “Compuetername” Column B “OSVersion”
Thanks