• Name: Get-SystemInfo
  • Author: Thomas Novak
  • Version: 1.1
  • Date created: 2019-09-06
This function generates a summary of a local or remote computer system configuration by querying CIM classes, including:

  • Hardware model
  • Processor (Model, Frequency, number of physical/logical cores)
  • Operating system version
  • Uptime
  • Network interfaces and IP addresses
  • Logical disks (drive letter, file system type, name, remaining and total capacity)
  • Memory installed (free / total amount)
  • Pagefile configuration
  • Powershell version installed

 

Usage:

Load the function into memory by dot-sourcing the script file. This makes the Get-SystemInfo function available in your current PowerShell session:

 

PowerShell
Upravit|Odebrat
. .\Get-SystemInfo.ps1
 Run this cmdlet to gather localhost system information:
PowerShell
Upravit|Odebrat
Get-SystemInfo 
or use the alias gsi 
 Run this cmdlet to gather remote computer system information with ComputerName parameter specifying remote computer hostnames:
PowerShell
Upravit|Odebrat
Get-SystemInfo -ComputerName server01,server02 
gsi server01,server02
 
PowerShell
Upravit|Odebrat
'server01','server02' | Get-SystemInfo 
'server01','server02' | gsi
 

 

Example of output:

PowerShell
Upravit|Odebrat
Hostname       : Server5 
Model          : ProLiant BL460c Gen9 
Uptime         : 0 days 11 hours (Last Boot: 9/5/2019 11:16:31 PM) 
Processor      : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz (12 Core(s), 24 Logical Processor(s)) 
OS             : Microsoft Windows Server 2012 R2 Standard (64-bit) 
IPAddress      : PROD - 165.x.x.147, 165.x.x.36 
                 BARN - 2.x.x.151, 2.x.x.149 
LogicalDisks   : [NTFS] C:\ (SYSTEM) = 85.09 / 278.45 GB (30.6% Free) 
                 [NTFS] F:\ (wv589-SQLData_prod) = 98.82 / 400.06 GB (24.7% Free) 
                 [NTFS] G:\ (wv589-SQLLog_prod) = 36.06 / 50.02 GB (72.1% Free) 
                 [NTFS] H:\ (wv589-SQLData_arch) = 73.36 / 300.02 GB (24.5% Free) 
                 [NTFS] I:\ (wv589-SQLLog_arch) = 32.58 / 40.00 GB (81.5% Free) 
                 [NTFS] J:\ (wv589-SQLTempdb) = 42.10 / 74.92 GB (56.2% Free) 
Memory         : 5.03 / 63.87 GB Free 
PageFile       : C:\pagefile.sys - 24.04 GB / 24.04 GB (Initial/Maximum) 
PSVersion      : 5.1
 
Synopsis:

 

PowerShell
Upravit|Odebrat
    <# 
        .SYNOPSIS 
        Generates a summary of local or remote computer system configuration 
 
        .DESCRIPTION 
        This function generates a summary of a local or remote computer system configuration by querying CIM classes, including: 
 
        Hardware model 
        Processor (Model, Frequency, number of physical/logical cores) 
        Operating system version 
        Uptime 
        Network interfaces and IP addresses 
        Logical disks (drive letter, file system type, name, remaining and total capacity) 
        Memory installed (free / total amount) 
        Pagefile configuration 
        Powershell version installed 
 
        .NOTES    
        Name       : Get-SystemInfo 
        Author     : Thomas Novak 
        Version    : 1.0 
        DateCreated: 2018-09-24 
 
        .PARAMETER ComputerName 
        The computer hostname to query for information 
 
        .EXAMPLE 
        Get-SystemInfo 
 
        Description: 
        Will query localhost for system information 
 
        .EXAMPLE 
        Get-SystemInfo -ComputerName server01,server02 
 
        Description: 
        Will query remote computers server01 and server02 for system information 
 
        .EXAMPLE 
        'server01','server02' | Get-SystemInfo 
 
        Description: 
        Will query remote computers server01 and server02 for system information 
    #>