Created
June 16, 2022 03:59
-
-
Save aymenjaz/6e70cbe3011159ffdcc4940e3b5afd21 to your computer and use it in GitHub Desktop.
Desktop-Laptop Hardware Config
This file contains hidden or 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
$ConfigPC = [ordered]@{ | |
'computer_Name' = (Get-CimInstance -ClassName Win32_ComputerSystem).Name | |
'OpearatingSystem' = (Get-CimInstance -ClassName Win32_OperatingSystem).Caption | |
'NbProcessors' = (Get-CimInstance -ClassName Win32_ComputerSystem).NumberofProcessors | |
'ProcessorName' = (Get-CimInstance -ClassName Win32_Processor).Name | |
'NbLogicalProcessors' = (Get-CimInstance -ClassName Win32_ComputerSystem).NumberOfLogicalProcessors | |
'RAM' = [Math]::Round((Get-CimInstance -ClassName Win32_ComputerSystem).TotalPhysicalMemory / 1GB , 2) | |
'HDD' = [Math]::Round((Get-CimInstance -ClassName Win32_DiskDrive).Size / 1GB , 2 ) | |
} | |
[array]$TABCONFIG = $ConfigPC.Values | |
Write-Host "computer Name : " $TABCONFIG[0] | |
Write-Host "Opearating System : " $TABCONFIG[1] | |
Write-Host "Nb Processors : " $TABCONFIG[2] | |
Write-Host "Processor Name : " $TABCONFIG[3] | |
Write-Host "NbLogical Processors : " $TABCONFIG[4] | |
Write-Host "RAM : " $TABCONFIG[5] | |
Write-Host "HDD : " $TABCONFIG[6] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment