$infile = read-host "Provide full path of input file of the servers." @( Foreach ($strComputer in gc $infile) { Write-host $strComputer $sysItems = get-wmiobject -class "Win32_ComputerSystem" -namespace "root\CIMV2" -computername $strComputer $OSItems = get-wmiobject -class "Win32_OperatingSystem" -namespace "root\CIMV2" -computername $strComputer foreach ($objSiItem in $sysItems) { # write-host $MkbSize = $objSiItem.TotalPhysicalMemory / 1024 / 1024 / 1024 write-host } write-output $strComputer write-output "Number of Processors :$($objSiItem.NumberOfProcessors)`n" }) | out-File C:\pscripts\output\Guru_info_CPU.csv -enc ASCII -append