SCRIPT: Get-SystemInfo.ps1 LANGUAGE: PowerShell DIFFICULTY: Beginner CATEGORY: Utility VERSION: 1.0 UPDATED: 2024-12-21 ================================================================================ SUMMARY ================================================================================ A PowerShell script that gathers comprehensive system information including OS version, hardware specifications, network configuration, and installed software. Useful for inventory management and system troubleshooting. ================================================================================ WHAT IT DOES ================================================================================ This script collects and displays detailed information about your Windows computer: - Operating System: Name, version, build number, architecture, install date, last boot time - Computer: Name, domain, manufacturer, model, total RAM - Processor: CPU name, core count, logical processors, clock speed - Disk Drives: For each drive - total size, free space, percentage free, file system - Network Adapters: IP address, subnet, gateway, DNS servers, MAC address - Running Services: Top 20 currently running Windows services - Installed Software: (Optional) Complete list of programs with version and vendor ================================================================================ HOW TO USE ================================================================================ Basic usage (display in console): .\Get-SystemInfo.ps1 Save to file: .\Get-SystemInfo.ps1 -OutputPath "C:\Reports\SystemInfo.txt" Include installed software list: .\Get-SystemInfo.ps1 -IncludeSoftware Combine options: .\Get-SystemInfo.ps1 -OutputPath "C:\Reports\FullReport.txt" -IncludeSoftware ================================================================================ PARAMETERS ================================================================================ -OutputPath (Optional) If specified, saves the report to a text file at this location. If not specified, the report displays in the console. Example: -OutputPath "C:\Reports\SystemInfo.txt" -IncludeSoftware (Optional Switch) When included, adds a list of all installed software to the report. Note: This takes longer on systems with many installed programs. Example: -IncludeSoftware ================================================================================ THINGS TO BE CAREFUL OF ================================================================================ 1. EXECUTION POLICY: Windows may block scripts by default. Run this first: Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process 2. UNBLOCK FILE: If downloaded from the internet, you may need to unblock: Unblock-File -Path ".\Get-SystemInfo.ps1" 3. SOFTWARE LIST IS SLOW: The -IncludeSoftware parameter queries Win32_Product, which can take several minutes on systems with many programs installed. 4. ADMINISTRATOR: Some information may require administrator privileges to access. Run PowerShell as Administrator for complete results. 5. NETWORK ADAPTERS: Only shows adapters with IP enabled (active connections). ================================================================================ INPUTS ================================================================================ None required. The script reads from the local system. ================================================================================ OUTPUTS ================================================================================ - Console output: Formatted text report displayed in PowerShell - File output: UTF-8 encoded text file (if -OutputPath is specified) Exit codes: - 0: Success - 1: Error occurred during collection ================================================================================ REQUIREMENTS ================================================================================ - Windows PowerShell 5.1 or higher - Windows operating system - No external modules required ================================================================================ EXAMPLE OUTPUT ================================================================================ ============================================================ SYSTEM INFORMATION REPORT Generated: 2024-12-21 14:30:00 ============================================================ OPERATING SYSTEM ---------------------------------------- Name: Microsoft Windows 11 Pro Version: 10.0.22631 Build: 22631 Architecture: 64-bit ...