1
# Display processor information
2
Write-Host "`nProcessor Information:`n" -ForegroundColor Cyan
3
Get-CimInstance -ClassName Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors | Format-Table -AutoSize
4
# Display BIOS information
5
Write-Host "`nBIOS Information:`n" -ForegroundColor Cyan
6
Get-CimInstance -ClassName Win32_BIOS | Select-Object Manufacturer, Name, Version, SerialNumber | Format-Table -AutoSize
7
# Display computer manufacturer and model
8
Write-Host "`nComputer Manufacturer and Model:`n" -ForegroundColor Cyan
9
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Manufacturer, Model | Format-Table -AutoSize
10
# List operating system version information
11
Write-Host "`nOperating System Version Information:`n" -ForegroundColor Cyan
12
Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber, OSArchitecture | Format-Table -AutoSize
13
# List local users
14
Write-Host "`nLocal Users:`n" -ForegroundColor Cyan
15
Get-LocalUser | Select-Object Name, Enabled | Format-Table -AutoSize
16
# List installed hotfixes
17
Write-Host "`nInstalled Hotfixes:`n" -ForegroundColor Cyan
18
Get-HotFix | Select-Object HotFixID, Description, InstalledOn | Format-Table -AutoSize
19
# Display available disk space
20
Write-Host "`nAvailable Disk Space:`n" -ForegroundColor Cyan
21
Get-CimInstance -ClassName Win32_LogicalDisk | Where-Object { $_.DriveType -eq 3 } |
22
Select-Object DeviceID, @{Name="Total Size (GB)";Expression={"{0:N2}" -f ($_.Size / 1GB)}},
23
@{Name="Free Space (GB)";Expression={"{0:N2}" -f ($_.FreeSpace / 1GB)}} | Format-Table -AutoSize
24
# Display the user logged on to a computer
25
Write-Host "`nUser Logged On:`n" -ForegroundColor Cyan
26
$LoggedOnUser = (Get-CimInstance -ClassName Win32_ComputerSystem).UserName
27
if ($LoggedOnUser) {
28
Write-Host "Current User: $LoggedOnUser"
29
} else {
30
Write-Host "No user is logged in."
31
}
32
# Display the local time from a computer
33
Write-Host "`nLocal Time:`n" -ForegroundColor Cyan
34
Get-Date
35
# Display all system and OS properties
36
Write-Host "`nAll System and OS Properties:`n" -ForegroundColor Cyan
37
Get-CimInstance -ClassName Win32_OperatingSystem | Format-List *
38
# Display BIOS properties
39
Write-Host "`nBIOS Properties:`n" -ForegroundColor Cyan
40
Get-CimInstance -ClassName Win32_BIOS | Format-List *
41
# Display version properties
42
Write-Host "`nVersion Properties:`n" -ForegroundColor Cyan
43
(Get-CimInstance -ClassName Win32_OperatingSystem).Version
44
# Display specific OS details
45
Write-Host "`nSpecific OS Details:`n" -ForegroundColor Cyan
46
Get-CimInstance -ClassName Win32_OperatingSystem |
47
Select-Object Caption, Version, BuildNumber, ServicePackMajorVersion, ServicePackMinorVersion, OSArchitecture | Format-List