Hello All ,
I have created below Script, the script is working fine and display the correct output with NumberofCores on the Screen. like NumberofCores : {12, 12}
But when I export it into CSV, under the NumberofCores colum, it display "System.Object[] "
Here is my script"$servers = Get-Content C:\temp\servers.txt
$Output = @()
foreach ($server in $servers) {
if(test-path \\$server\C$)
{
$os = Get-WmiObject -Class win32_operatingsystem -ComputerName $server
$cpu = get-wmiobject Win32_ComputerSystem -ComputerName $server
$cores = get-wmiobject Win32_Processor -ComputerName $server
$data = @{
"ServerName" = $os.PSComputerName
"Model" = $cpu.model
"OS" = $os.caption
"OSArchitecture" = $os.OSArchitecture
"NumberOfProcessors" = $cpu.NumberOfProcessors
"NumberofCores" = $cores.NumberOfCores
"NumberOfLogicalProcessors" = $cpu.NumberOfLogicalProcessors
}
$output= New-Object -TypeName psobject -Property $data
$output | Export-Csv C:\temp\Info.CSV -Append -NoTypeInformation
}
else
{
write-output "$server" | out-file c:\temp\errors.txt
}
}
Regards Baneesh Pal Singh