# PCS Toolkit - System Information Gatherer # Collects comprehensive system info for diagnostics $ErrorActionPreference = 'SilentlyContinue' $timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss" $outputFile = "$env:USERPROFILE\Desktop\SystemInfo_$timestamp.txt" function Log($msg) { Write-Host $msg Add-Content $outputFile $msg } function Section($title) { $line = "=" * 60 Log "" Log $line Log $title Log $line Write-Host "Collecting: $title" -ForegroundColor Yellow } Log "System Information Report" Log "Generated: $(Get-Date)" Log "Computer: $env:COMPUTERNAME" Log "Output: $outputFile" Section "BASIC SYSTEM INFORMATION" Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber, OSArchitecture, InstallDate, LastBootUpTime | Format-List | Out-String | ForEach-Object { Log $_ } Section "HARDWARE" Get-CimInstance Win32_ComputerSystem | Select-Object Manufacturer, Model, TotalPhysicalMemory, NumberOfProcessors | Format-List | Out-String | ForEach-Object { Log $_ } Get-CimInstance Win32_Processor | Select-Object Name, NumberOfCores, MaxClockSpeed | Format-List | Out-String | ForEach-Object { Log $_ } Section "MEMORY" Get-CimInstance Win32_PhysicalMemory | Select-Object BankLabel, Capacity, Speed | Format-Table | Out-String | ForEach-Object { Log $_ } Section "DISKS" Get-CimInstance Win32_LogicalDisk -Filter "DriveType=3" | Select-Object DeviceID, VolumeName, @{N='Size(GB)';E={[math]::Round($_.Size/1GB,2)}}, @{N='Free(GB)';E={[math]::Round($_.FreeSpace/1GB,2)}}, @{N='%Free';E={[math]::Round(($_.FreeSpace/$_.Size)*100,1)}} | Format-Table | Out-String | ForEach-Object { Log $_ } Section "NETWORK" Get-NetIPConfiguration | Format-List | Out-String | ForEach-Object { Log $_ } Get-NetAdapter | Select-Object Name, Status, MacAddress, LinkSpeed | Format-Table | Out-String | ForEach-Object { Log $_ } Section "INSTALLED SOFTWARE (Top 30)" Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher | Where-Object { $_.DisplayName } | Sort-Object DisplayName | Select-Object -First 30 | Format-Table -AutoSize | Out-String | ForEach-Object { Log $_ } Section "RUNNING SERVICES" Get-Service | Where-Object {$_.Status -eq "Running"} | Select-Object Name, DisplayName | Format-Table -AutoSize | Out-String | ForEach-Object { Log $_ } Section "RECENT UPDATES (Last 10)" Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 10 | Format-Table | Out-String | ForEach-Object { Log $_ } Section "ANTIVIRUS STATUS" Get-CimInstance -Namespace root\SecurityCenter2 -ClassName AntiVirusProduct | Select-Object displayName, productState | Format-List | Out-String | ForEach-Object { Log $_ } Log "" Log "========================================" Log "REPORT COMPLETE" Log "========================================" Write-Host "Report saved to: $outputFile" -ForegroundColor Green explorer.exe "/select,$outputFile" Read-Host "Press Enter to exit"