r/PowerShell • • Feb 28 '26

My new Script

Hey r/PowerShell,

I've created a comprehensive Windows 11 post-install PowerShell script that applies my preferred optimizations with a nice colored CLI interface:
๐Ÿ‘‰ย My script

Key Features:

text๐Ÿ”‘ Windows License: Optional Pro upgrade (with key in clipboard)
โšก Power Settings: Hibernate config, lid/power button actions, no sleep timeout
๐ŸŽจ Dark Mode: Apps + Windows + Transparency enabled, startup sound on
๐Ÿ“‹ Taskbar: Center aligned, hides widgets/search/TaskView, shows seconds
๐Ÿ“ File Explorer: Shows extensions/hidden files, This PC landing, compact mode
๐Ÿ  Start Menu: Shows all pinned folders (Documents/Downloads/etc), no Bing/recommendations
๐Ÿ”’ Privacy: Disables telemetry, OneDrive sync, Cortana, activity history, ads
๐Ÿ›ก๏ธ Security: Max UAC, Ctrl+Alt+Del required, no autorun, hides last username
๐ŸŽฎ Gaming: Disables Game DVR/Xbox Game Bar
โœจ Extras: Developer mode, detailed BSOD, restarts Explorer

Smart Features:

  • Test Modeย (-Test): Dry-run preview without changes
  • Safe Registry: Validates keys exist before writing, detailed error handling
  • Auto-elevate: Restarts as admin if needed
  • Visual feedback: Colored status (โœ“โœ—โ†’โ†ป) with timestamps per action
  • Requires rebootย prompt at end

Usage:ย .\winconf.ps1ย orย .\winconf.ps1 -Testย for preview

Questions:

  • Code quality? Readability, error handling, PowerShell best practices?โ€‹
  • Security concerns? Registry changes look safe?
  • Missing optimizations you'd add for daily driver/gaming setup?
  • PowerShell style: Functions structure, parameter validation OK?

All open source - fork/pull requests welcome! Looking for constructive feedback before wider use.

Thanks! ๐Ÿš€

0 Upvotes

21 comments sorted by

View all comments

Show parent comment

1

u/I_see_farts Feb 28 '26

Yeah, changing the product key to a Generic key doesn't activate Windows. I don't know how many people who use this script fully understand what it's doing.

I do have a question though about this script: Why would the make a whole new Function that pretty much does exactly what set-itemproperty does? I looked over the script this morning and couldn't figure that out?

1

u/BlackV Feb 28 '26

Logging and errors handling by the looks

1

u/Certain_Bet_7145 Feb 28 '26

I know it doesn't activate Windows but it at least allows you to get to the right version more quickly.

I use a function to manage key absence/error and to add functions like -Description.

sorry for my English, I am French

2

u/I_see_farts Mar 01 '26

sorry for my English, I am French

No problem. I could tell by looking at your script.

Good job!