r/PowerShell • u/Certain_Bet_7145 • 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 ExplorerSmart 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
11
u/ExceptionEX Feb 28 '26
I think this is a low effort post, that isn't worth my time to review if it isn't worth your time to talk more about it.
4
u/Nitricta Feb 28 '26
Your script has no soul my brother.
2
u/BlackV Feb 28 '26 edited Feb 28 '26
so many emojies :( (I know that's personal preference)
as others mentioned have a look at splatting and this article, cause you seem to have a million back ticks in 1 place then none in another
Here for example
but not here calling the same command
doing it constantly the same throughout your code makes it better (I am making the assumption this is due to LLM usage)
have a look at this article
https://get-powershellblog.blogspot.com/2017/07/bye-bye-backtick-natural-line.html
have a look at here strings
Instead of
try
or just get rid of it entirely
good to see you using switches instead of many if/else/ifelse in some places, unfortunately not others
you have this
-expermentaland-testswitch I would use powershells build in features and replace the-testwith-whatifrandomly adding/change peoples windows editions and installing keys is not something very trust worthy, be clear what/where/why
there is 0 help at all with this script, you should add help, and personally details on the settings you are changing and why
your
HKCUkeys make the assumption that the admin user running the script is the same user that logs in (my admin account is not my daily account)are there some idea you coudl steal from this script too
https://www.reddit.com/r/PowerShell/comments/1rh4uek/i_built_a_modular_powershell_suite_to_debloat_and/
4
u/I_see_farts Feb 28 '26 edited Feb 28 '26
If you need the script to run as Administrator, just put
#REQUIRES -RunAsAdministratorat the top of the script. It'll throw an error if tried to run otherwise.I'm not a fan of Backticks, why not go through and splat out all your Registry tweaks?
Looks cleaner and doesn't need Backticks.
1
u/Particular_Fish_9755 Feb 28 '26
I think of two things when I see these kinds of scripts intended for users:
1-There are registry keys in HKLM and others in HKCU.
Why not separate it with a test if the script is run as administrator to modify the keys in HKLM?
2-Why not a proper graphical interface with a choice of options? In WPF or WinForms?