WMI provides an immense amount of information about the current system or remote systems. In fact, the msinfo32.exe application traditionally used to gather system information is based largely on WMI.
The script shown in Example 246 summarizes the most common information, but WMI provides a great deal more than that.
Example 246. GetDetailedSystemInformation.ps1
############################################################################## ## ## GetDetailedSystemInformation.ps1 ## ## Get detailed information about a system. ## ## ie: ## ## PS >GetDetailedSystemInformation LEEDESK > output.txt ## ##############################################################################
param( $computer = "." )
"#"*80 "System Information Summary" "Generated $(GetDate)" "#"*80 "" ""
"#"*80 "Computer System Information" "#"*80 GetWmiObject Win32_ComputerSystem Computer $computer | FormatList *
"#"*80 "Operating System Information" "#"*80 GetWmiObject Win32_OperatingSystem Computer $computer | FormatList *
"#"*80 "BIOS Information" "#"*80 GetWmiObject Win32_Bios Computer $computer | FormatList *
Example 246. GetDetailedSystemInformation.ps1 (continued)
"#"*80 "Memory Information" "#"*80 GetWmiObject Win32_PhysicalMemory Computer $computer | FormatList *
"#"*80 "Physical Disk Information" "#"*80 GetWmiObject Win32_DiskDrive Computer $computer | FormatList *
"#"*80 "Logical Disk Information" "#"*80 GetWmiObject Win32_LogicalDisk Computer $computer | FormatList *