PowerShell
Low risk
Generate a quick inventory of a Windows PC
Shows model, serial number, Windows, processor, memory and disks of the station.
$Computer = Get-CimInstance Win32_ComputerSystem
$BIOS = Get-CimInstance Win32_BIOS
$OS = Get-CimInstance Win32_OperatingSystem
$CPU = Get-CimInstance Win32_Processor | Select-Object -First 1
[PSCustomObject]@{
Name = $env:COMPUTERNAME
Fabricant = $Computer.Manufacturer
Modele = $Computer.Model
NumeroSerie = $BIOS.SerialNumber
Windows = $OS.Caption
Version = $OS.Version
Processeur = $CPU.Name
RAM_Go = [math]::Round($Computer.TotalPhysicalMemory / 1GB, 1)
}
Get-Volume | Where-Object DriveLetter | Select-Object DriveLetter, FileSystemLabel, @{N='Taille_Go';E={[math]::Round($_.Size/1GB,1)}}, @{N='Libre_Go';E={[math]::Round($_.SizeRemaining/1GB,1)}}
When should you use it?
Useful for an audit, workstation replacement preparation, or an intervention report.
What the script does
- Get-CimInstance queries local hardware and operating-system information.
- The result can be copied or exported with Export-Csv.
Precautions
- Some virtual machines or BIOS implementations may return a generic serial number.
Rollback
No changes are made to the system.