mirror of
https://github.com/alexandrebobkov/Components.git
synced 2024-10-05 20:47:47 -04:00
Create buildinfo.ps1
This commit is contained in:
parent
579e8d849b
commit
0587342aaa
32
assets/buildinfo.ps1
Normal file
32
assets/buildinfo.ps1
Normal file
@ -0,0 +1,32 @@
|
||||
# Author: Alexander B.
|
||||
# This PowerShell script collects information about computer hardware and saves it in a text file.
|
||||
|
||||
$System = Get-CimInstance CIM_ComputerSystem
|
||||
$OS = Get-CimInstance CIM_OperatingSystem
|
||||
$CPU = Get-CimInstance CIM_Processor
|
||||
$Storage = Get-CimInstance Win32_LogicalDisk -Filter "DeviceID = 'C:'"
|
||||
$InfoFile = "pcbuildinfo.txt"
|
||||
|
||||
Write-Host "PC Hardware Information"
|
||||
# Write computer configuration to a text file
|
||||
"PC Hardware Information" > $InfoFile
|
||||
" " >> $InfoFile
|
||||
"This is " + $System.Model + ", and was manufactured by " + $System.Manufacturer >> $InfoFile
|
||||
"The name of this computer is " + $System.Name + "." >> $InfoFile
|
||||
"The operating system installed on this computer is " + $OS.caption >> $InfoFile
|
||||
" " >> $InfoFile
|
||||
"The CPU, RAM and free storage space are as follows: " >> $InfoFile
|
||||
" " >> $InfoFile
|
||||
"CPU: " +$CPU.Name >> $InfoFile
|
||||
"RAM: " + "{0:N2}" -f ($System.TotalPhysicalMemory/1GB) + " GB" >> $InfoFile
|
||||
"HDD Capacity: " + "{0:N2}" -f ($Storage.Size/1GB) + " GB" >> $InfoFile
|
||||
|
||||
# Print hardware summary on a screen
|
||||
Write-Host "Model: " $System.Model
|
||||
Write-Host "Computer: " $System.Name
|
||||
Write-Host "OS: " $OS.Caption
|
||||
Write-Host "CPU: " $CPU.Name
|
||||
|
||||
#tree /f > directory.txt
|
||||
|
||||
# > pcbuildinfo.txt
|
Loading…
Reference in New Issue
Block a user