Created
November 24, 2016 04:28
-
-
Save nazwadi/7afb343c28128ee486949b01f0870ce8 to your computer and use it in GitHub Desktop.
Windows - Print Local System Information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$computerSystem = Get-CimInstance CIM_ComputerSystem | |
$computerBIOS = Get-CimInstance CIM_BIOSElement | |
$computerOS = Get-CimInstance CIM_OperatingSystem | |
$computerCPU = Get-CimInstance CIM_Processor | |
$computerHDD = Get-CimInstance Win32_LogicalDisk -Filter "DeviceID = 'C:'" | |
Clear-Host | |
Write-Host "System Information for: " $computerSystem.Name -BackgroundColor DarkCyan | |
"Manufacturer: " + $computerSystem.Manufacturer | |
"Model: " + $computerSystem.Model | |
"Serial Number: " + $computerBIOS.SerialNumber | |
"CPU: " + $computerCPU.Name | |
"HDD Capacity: " + "{0:N2}" -f ($computerHDD.Size/1GB) + "GB" | |
"HDD Space: " + "{0:P2}" -f ($computerHDD.FreeSpace/$computerHDD.Size) + " Free (" + "{0:N2}" -f ($computerHDD.FreeSpace/1GB) + "GB)" | |
"RAM: " + "{0:N2}" -f ($computerSystem.TotalPhysicalMemory/1GB) + "GB" | |
"Operating System: " + $computerOS.caption + ", Service Pack: " + $computerOS.ServicePackMajorVersion | |
"User logged In: " + $computerSystem.UserName | |
"Last Reboot: " + $computerOS.LastBootUpTime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment