PowerShell Mastery Hub

Complete collection of system scripts, audits, and power-user commands.

How to Open Script Security Navigation System Audit WinUtil Tool Cleanup & Fixes Create .ps1 Script
Step 1: Open PowerShell as Admin

🛡️ How to open PowerShell as Admin

Before running commands, you must ensure you have full administrative permissions. Use any of these methods:

2. Foundations & Security
Security
Allow Script Execution

By default, Windows blocks script files. Run this to allow locally created .ps1 files to execute on your machine.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Navigation
Navigate & Run Script

To run a file, move PowerShell to that folder first.
Example: If your script is named setup.ps1 in a folder called "Work", use the steps below.

cd "C:\Users\YourName\Desktop\Work" .\setup.ps1
4. Deep System Audits
Audit & Export
Export All Apps to Desktop

Scans every registry path and creates a neat file called All_Apps_List.txt on your desktop.

Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*, HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | Sort-Object DisplayName > $env:USERPROFILE\Desktop\All_Apps_List.txt
5. Optimization & Cleanup
Utility
WinUtil (Chris Titus Tool)

Opens an interactive GUI to debloat Windows and install essential apps instantly.

irm christitus.com/win | iex
Cleanup
Empty All Recycle Bins

Instantly empties the trash for all users on all drives without asking for confirmation.

Clear-RecycleBin -Force -ErrorAction SilentlyContinue
Repair
System File Repair (SFC/DISM)

Fixes corrupted Windows system files and repairs the internal recovery image.

dism /online /cleanup-image /restorehealth; sfc /scannow
How to Create & Save a Script

📄 Creating a .ps1 Script

Follow these steps to save your commands as a permanent tool:

  1. Open Notepad.
  2. Paste your code inside.
  3. Select File > Save As.
  4. Name your file (e.g., CleanMyPC.ps1).
  5. Important: Change "Save as type" to All Files (*.*).
  6. Click Save. It is now a PowerShell script!