A dual-purpose PowerShell repository: an educational reference for learning PowerShell deeply, and a practical toolkit of real utility scripts.
| Wing | Purpose | License |
|---|---|---|
๐ Learn/ |
Annotated PowerShell deep-dive (5 modules, 7 files) | CC BY-SA 3.0 |
๐ ๏ธ Scripts/ |
Practical utility scripts across 6 categories | Original work by Quadstronaut |
๐ฆ Scripts inventory at a glance
| Category | Scripts | Key theme |
|---|---|---|
| Windows Maintenance | 4 | SFC, DISM, Chocolatey, Windows Update |
| Package Managers | 3 | Chocolatey, Scoop, Python |
| Safe Mode | 2 | bcdedit boot flag wrangling |
| Utilities | 6 | Windows admin quality-of-life |
| AWS | 2 | CLI setup + account hardening |
| Gaming | 2 | Elite Dangerous multi-account, Steam verify |
| Discord | 1 | Webhook rich embeds |
| Fun | 1 | Pi via Leibniz formula |
PotentPowershell/
โโโ Learn/ # Annotated learning files (CC BY-SA 3.0)
โ โโโ 01-Basics/
โ โ โโโ 01-datatypes-and-operators.ps1
โ โ โโโ 02-variables-and-collections.ps1
โ โ โโโ 03-control-flow.ps1
โ โโโ 02-Functions/
โ โ โโโ 01-functions.ps1
โ โโโ 03-Modules/
โ โ โโโ 01-modules.ps1
โ โโโ 04-Classes/
โ โ โโโ 01-classes-and-inheritance.ps1
โ โโโ 05-Advanced/
โ โโโ 01-advanced-topics.ps1
โ
โโโ Scripts/ # Practical utility scripts
โโโ AWS/
โ โโโ Invoke-AwsConfigure.ps1
โ โโโ New-AwsAccount.ps1
โโโ Discord/
โ โโโ Send-RichEmbed.ps1
โโโ Fun/
โ โโโ Get-PiApproximation.ps1
โโโ Gaming/
โ โโโ Start-EDMultiAccount.ps1
โ โโโ Invoke-SteamVerification.ps1
โโโ Windows/
โโโ Maintenance/
โ โโโ Invoke-SystemUpgrade.ps1
โ โโโ Invoke-DiskCheck.ps1
โ โโโ Get-ErrorReport.ps1
โ โโโ Invoke-SfcDism.ps1
โโโ PackageManagers/
โ โโโ Import-ChocolateyPackages.ps1
โ โโโ Update-PythonInstallation.ps1
โ โโโ Invoke-ScoopBrowser.ps1
โโโ SafeMode/
โ โโโ Enter-SafeMode.ps1
โ โโโ Exit-SafeMode.ps1
โโโ Utilities/
โโโ Get-OpenWindows.ps1
โโโ Set-AdminAutoElevate.ps1
โโโ Remove-Silverlight.ps1
โโโ Get-ScreenGeometry.ps1
โโโ Sync-Directories.ps1
โโโ Start-MSRewards.ps1
mindmap
root((PotentPowershell))
Learn
01-Basics
datatypes-and-operators
variables-and-collections
control-flow
02-Functions
functions
03-Modules
modules
04-Classes
classes-and-inheritance
05-Advanced
advanced-topics
Scripts
Windows
Maintenance
PackageManagers
SafeMode
Utilities
AWS
Gaming
Discord
Fun
The Learn/ files are annotated transcriptions of the LearnXInYMinutes PowerShell guide, with deep commentary on why PowerShell works the way it does. Comments explain concepts that seem weird compared to Python, Bash, C#, or JavaScript.
| # | File | Key concepts covered |
|---|---|---|
| 1 | 01-Basics/01-datatypes-and-operators.ps1 |
Numbers, Banker's rounding, strings, escape characters, booleans, comparison operators (-eq, -lt), logical operators (-and, -or) |
| 2 | 01-Basics/02-variables-and-collections.ps1 |
The $ sigil, fixed-size arrays, ArrayList, hashtables, ordered hashtables, splatting, tuples |
| 3 | 01-Basics/03-control-flow.ps1 |
if/elseif/else, switch (no fall-through!), foreach vs ForEach-Object, try/catch/finally, -ErrorAction Stop |
| 4 | 02-Functions/01-functions.ps1 |
Parameters, implicit return, [CmdletBinding()], BEGIN/PROCESS/END blocks, ValidateSet, splatting |
| 5 | 03-Modules/01-modules.ps1 |
Install-Module vs Chocolatey/Scoop, PSGallery, writing modules, dot-sourcing |
| 6 | 04-Classes/01-classes-and-inheritance.ps1 |
::new() vs New-Object, inheritance, $this, static members, enums, flags |
| 7 | 05-Advanced/01-advanced-topics.ps1 |
Pipeline objects vs text (Bash comparison), jobs, PSRemoting, & vs Invoke-Expression, execution policy |
Click to expand โ the peculiar PowerShell pitfalls, properly prosecuted
| Topic | The Peculiarity |
|---|---|
| Banker's rounding | Why [Math]::Round(2.5) returns 2, not 3 |
| Fixed-size arrays | Why += is O(nยฒ) and when to use ArrayList instead |
| Tuples | What immutability actually gives you (safety, intent, thread-safety) |
$ sigil |
Where it comes from (Unix shell heritage) |
-eq on arrays |
Why it filters instead of comparing |
-and/-or instead of &&/|| |
Why the shell reserved those symbols |
| Backtick escape | Why not backslash (Windows paths) |
[CmdletBinding()] |
Every common parameter you get for free |
| BEGIN/PROCESS/END | Why without PROCESS you only get the last pipeline item |
& vs Invoke-Expression |
Scope difference and why iex is dangerous |
| Pipeline objects vs Bash text | The single biggest conceptual shift |
| Script | What it does | Admin required |
|---|---|---|
Invoke-SystemUpgrade.ps1 |
Installs Chocolatey if missing, runs SFC + DISM in background, upgrades all Chocolatey packages, upgrades pip, installs Windows Updates (no forced reboot) | Yes |
Invoke-DiskCheck.ps1 |
Runs chkdsk C: /f /r (auto-elevates; on a live C: drive, check is scheduled for next reboot) |
Auto-elevates |
Get-ErrorReport.ps1 |
Application/System event log error summary. Parameters: -DaysBack (default 7), -ErrorThreshold (default 10) |
Recommended |
Invoke-SfcDism.ps1 |
Reference script โ documents every SFC and DISM repair command with annotations. Not meant to be run top-to-bottom; copy individual commands as needed. | Yes (per command) |
Tip
Invoke-SystemUpgrade.ps1 is the one-stop power-punch: Chocolatey + SFC + DISM + pip + Windows Updates, all in one pristine pass.
| Script | What it does | Admin required |
|---|---|---|
Import-ChocolateyPackages.ps1 |
Scans Program Files for executables that have matching Chocolatey packages; installs Chocolatey if missing, pins found packages, then upgrades them |
Yes |
Update-PythonInstallation.ps1 |
Detects installed Python versions via Chocolatey or registry; upgrades to latest, removes older versions, upgrades pip, optionally deletes virtualenvwrapper-style venvs (~\Envs) |
Yes |
Invoke-ScoopBrowser.ps1 |
Interactive Scoop package browser โ shows info for each package and installs selected ones as background jobs | No |
| Script | What it does | Admin required |
|---|---|---|
Enter-SafeMode.ps1 |
Sets bcdedit Safe Mode with Networking flag and immediately reboots. Will reboot the machine. |
Yes |
Exit-SafeMode.ps1 |
Clears the bcdedit safeboot value. Does not reboot โ restart manually when ready. |
Yes |
Warning
Enter-SafeMode.ps1 will reboot the machine immediately after setting the bcdedit flag. Save everything first.
| Script | What it does | Admin required |
|---|---|---|
Get-OpenWindows.ps1 |
Lists all processes with visible windows and their titles | No |
Set-AdminAutoElevate.ps1 |
Sets execution policy to Unrestricted for current user, creates the PowerShell profile if absent, appends an auto-elevation snippet. Note: Unrestricted is broader than RemoteSigned. |
Auto-elevates |
Remove-Silverlight.ps1 |
Silently uninstalls Silverlight, removes registry entries, deletes remaining files from disk and AppData. Safe no-op if Silverlight is not installed. | Recommended |
Get-ScreenGeometry.ps1 |
Reports full bounds and working area (excluding taskbar) for all connected monitors | No |
Sync-Directories.ps1 |
Robocopy-based directory sync (/E /XC /NP /ETA /MT:64). Parameters: -Source, -Destination (both mandatory) |
No |
Start-MSRewards.ps1 |
Opens Edge to the MS Edge Search Clicker page and closes it after a configurable wait. Parameter: -WaitSeconds (default 120). Hardcodes Edge path; exits with a warning if Edge is not found there. |
No |
Note
Set-AdminAutoElevate.ps1 sets execution policy to Unrestricted, which is broader than RemoteSigned. Understand the tradeoff before running.
| Script | What it does | Admin required |
|---|---|---|
Invoke-AwsConfigure.ps1 |
Interactive AWS CLI setup: checks for saved credentials, offers to reuse them, installs/upgrades awscli + awstools.powershell via Chocolatey, prompts for region selection, validates with aws s3 ls |
Yes (for Chocolatey) |
New-AwsAccount.ps1 |
Guided AWS account hardening walkthrough: IAM user/group/policy, billing budget + SNS alerts, CloudTrail, admin account, SSO. Note: several steps are stubs (VPC/EC2 deferred to Terraform); some cmdlets (Enable-IAMMFA, Test-IAMMFA, AWSPowerShellSSO) may not exist in all AWS.Tools versions โ verify module availability before running. |
No (uses AWS APIs) |
Important
New-AwsAccount.ps1 includes stubs โ VPC/EC2 steps are deferred to Terraform. Verify that Enable-IAMMFA, Test-IAMMFA, and AWSPowerShellSSO exist in your installed AWS.Tools version before running.
| Script | What it does | Admin required |
|---|---|---|
Start-EDMultiAccount.ps1 |
Launches multiple Elite Dangerous accounts simultaneously via Sandboxie Plus. Requires editing the $Accounts and $Sandboxes arrays in the USER CONFIG section before use. |
No |
Invoke-SteamVerification.ps1 |
Locates Steam via registry and runs -verify_all on the base installation. Known issue: per-game verification loop searches for appmanifests inside game subdirectories, but Steam stores them as appmanifest_<appid>.acf in the steamapps root โ the per-game loop will silently find nothing. Only the base install verification works reliably. |
Yes (registry) |
Caution
Invoke-SteamVerification.ps1 has a known bug: the per-game verification loop silently finds nothing. Only base install verification (-verify_all) works reliably.
Important
Start-EDMultiAccount.ps1 requires you to edit $Accounts and $Sandboxes in the USER CONFIG section before the script will do anything useful.
| Script | What it does | Admin required |
|---|---|---|
Get-PiApproximation.ps1 |
Approximates Pi using the Leibniz formula. Parameter: -Iterations (default 1,000,000). Slow to converge โ millions of terms for a few correct digits. |
No |
| Script | What it does | Admin required |
|---|---|---|
Send-RichEmbed.ps1 |
Posts a rich embed to a Discord channel webhook. Parameters: -WebhookUrl, -Title, -Description (all mandatory); -Color (decimal int, default 65280 = green), -Thumbnail (URL), -Author (hashtable with name/icon_url). Color must be decimal โ Discord does not accept hex strings. |
No |
Note
Send-RichEmbed.ps1 requires -Color as a decimal integer (e.g. 65280 for green). Discord's API does not accept hex strings.
# Run any script directly (some require admin)
.\Scripts\Windows\Maintenance\Invoke-SystemUpgrade.ps1
# Get help for any script
Get-Help .\Scripts\Windows\Utilities\Sync-Directories.ps1 -Full
# Open a Learn file in VS Code
code .\Learn\01-Basics\01-datatypes-and-operators.ps1Tip
For full per-script documentation, caveats, and troubleshooting, see the GitHub wiki.
Learn/ files are based on the LearnXInYMinutes PowerShell guide by Wouter Van Schandevijl and Andrew Ryan Davis, licensed under Creative Commons Attribution-ShareAlike 3.0 Unported. Annotations and commentary by Quadstronaut.
Scripts/ are original work by Quadstronaut unless otherwise noted in individual file headers.
| Resource | Link |
|---|---|
| ๐ PowerShell Documentation | learn.microsoft.com |
| ๐ LearnXInYMinutes โ PowerShell | learnxinyminutes.com |
| ๐ฆ PowerShell Gallery | powershellgallery.com |
| โ Approved Verbs for PowerShell Commands | learn.microsoft.com |
Practically perfect PowerShell, properly packaged, perpetually potent. ๐