Upgraded to V3 of PowerShell.
I have a script that runs on the first day of every month. One section of the script is gathering configs of our servers. Normally the output looks like this:
=======================
Host Name Manufacturer Model Serial Number Operating System Service Pack RAM in GB Physical CPUs Total CPU Cores 32-64-Bit OS Install Date Description
========================
With the appropriate settings pulled. Now it looks like this:
========================
IsReadOnly IsFixedSize IsSynchronized Keys Values SyncRoot Count
========================
Can someone shed some light on what changed?
Here is my code segment: (I know the array is redundantly redundant)
========================
New-Alias gwmic Get-WmiCustom
$in = ( "$path7\$file18" )
$out = ( "$Path7\$File17" )
(get-content $in) | % {
$OS = gwmic Win32_OperatingSystem -computername $_
$Computer = gwmic Win32_computerSystem -computername $_
$Bios= gwmic win32_bios -computername $_
$Proc = gwmic Win32_Processor -ComputerName $_
$Disk = gwmic Win32_LogicalDisk -ComputerName $_
#Query the classes needed for the report "" | Select `
@{Name="Host Name";Expression={$Computer.DNSHostName}},`
@{Name="Manufacturer";Expression={$Computer.Manufacturer}},`
@{Name="Model";Expression={$Computer.Model}},`
@{Name="Serial Number";Expression={$Bios.serialnumber}},`
@{Name="Operating System";Expression={$OS.Caption}},`
@{Name="Service Pack";Expression={$OS.CSDVersion}},`
@{Name="RAM in GB";Expression={"{0:N0}" -f ($computer.TotalPhysicalMemory/1GB)}},`
@{Name="Physical CPUs";Expression={$Computer.NumberOfProcessors}},`
@{Name="Total CPU Cores";Expression={$Computer.NumberOfLogicalProcessors}},`
@{Name="32-64-Bit OS";Expression={$Computer.SystemType}},`
@{Name="Install Date";Expression={[System.Management.ManagementDateTimeconverter]::ToDateTime($OS.InstallDate)}},`
@{Name="Description";Expression={$OS.Description}}
# Send the output to a .csv file based on the output variables above
} | Export-csv $out -notype
=========================================