Get-SystemInfo.ps1

PowerShell - Beginner - Utility

What It Does

This script gathers and displays basic information about your Windows computer. It reads data directly from Windows and presents it in an organized, easy-to-read format.

The script collects the following information:

How to Use

  1. Open PowerShell on your computer. You can do this by pressing the Windows key, typing "PowerShell", and pressing Enter.
  2. Navigate to the folder where you saved the script. For example, if you saved it in your Downloads folder, type the following command and press Enter:
cd ~\Downloads
  1. Run the script by typing the following command and pressing Enter:
.\Get-SystemInfo.ps1

The script will display your system information immediately. No input is required.

Expected Output

When the script runs successfully, you will see output similar to the following. Your actual values will differ based on your computer's hardware:

=== System Information ===

Computer Name:    DESKTOP-ABC123
Manufacturer:     Dell Inc.
Model:            XPS 15 9520

=== Operating System ===

OS Name:          Microsoft Windows 11 Pro
Version:          10.0.22621
Architecture:     64-bit

=== Processor ===

CPU:              12th Gen Intel(R) Core(TM) i7-12700H
Cores:            14
Logical CPUs:     20

=== Memory ===

Total RAM:        32 GB
Free RAM:         18.5 GB

=== Storage (C: Drive) ===

Total Space:      476.94 GB
Free Space:       203.12 GB

Understanding the Output

Here is what each section means:

Caution

This script only reads information. It does not change any settings or modify your computer in any way.

The script only checks the C: drive. If you have multiple drives, their information will not be displayed.

Requirements

Troubleshooting

If you see an error about "running scripts is disabled", you need to allow PowerShell to run scripts. Open PowerShell as Administrator and run the following command:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Type "Y" and press Enter when prompted. Then try running the script again.