Skip to content

harshad8782/PowerShell_Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

🖥️ PowerShell System Health Monitor

A PowerShell script that automatically collects and reports key system metrics — disk usage, CPU load, memory stats, and service status — and saves everything into a neatly formatted .txt report.


📁 Project Structure

powershell-system-monitor/
├── system_analyse_script.ps1   # Main PowerShell script
└── SystemReport.txt            # Auto-generated output report

⚙️ What the Script Does

  1. Disk Usage — Lists all drives with used and free space in GB
  2. CPU Usage — Fetches processor name, max clock speed, and current load percentage
  3. Memory Usage — Calculates used vs. free RAM as percentages
  4. Services Data — Separates and lists all Running and Stopped Windows services

📊 Sample Report Output

=== System Health Report ===
Generated On: 03/17/2026 20:04:55

--- Disk Usage ---
C     Used: 164.85 GB   Free: 131.76 GB
D     Used: 70.02 GB    Free: 79.98 GB

--- CPU Usage ---
AMD Ryzen 7 7435HS | Max Clock: 3100 MHz | Load: 14%

--- Memory Usage ---
Used Memory: 62.14%
Free Memory: 37.86%

--- Services Data ---
Running Services: Audiosrv, Dhcp, WSearch, MySQL80 ...
Stopped Services: WinRM, wuauserv, VSS ...

🚀 How to Run

Prerequisites: Windows with PowerShell 5.1+ or PowerShell 7+

# 1. Clone the repository
git clone https://github.com/your-username/powershell-system-monitor.git
cd powershell-system-monitor

# 2. Allow script execution (if not already set)
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

# 3. Run the script
.\system_analyse_script.ps1

The report will be saved as SystemReport.txt in the same directory.


🧠 Key Concepts Practiced

  • PowerShell variables and cmdlets
  • Get-PSDrive for disk information
  • Get-WmiObject Win32_Processor for CPU data
  • Get-CimInstance for memory metrics
  • Get-Service with filtering for running/stopped services
  • Writing formatted output to .txt files

🙏 Credits & Acknowledgements

This project was built while following the PowerShell tutorials by Automate with Rakesh on YouTube.

📺 Automate with Rakesh – YouTube Channel

Rakesh's tutorials are a fantastic resource for learning PowerShell automation and scripting from scratch — highly recommended!


📌 Notes

  • The report is timestamped at generation time (Generated On field).
  • The Temp drive entry maps to your user's AppData\Local\Temp directory.
  • Run as Administrator for complete service data access.

👨‍💻 Author

Harshad Raurale
DevOps / Cloud Enthusiast

GitHub LinkedIn


📄 License

This project is for learning purposes. Feel free to fork, modify, and build on it!

⭐ If you found this project helpful, please consider giving it a star!

About

PowerShell script that generates a real-time System Health Report covering disk usage, CPU load, memory stats, and running/stopped services. Outputs a formatted .txt report automatically. Built as a hands-on practice project following Automate with Rakesh's PowerShell tutorials on YouTube.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors