Turn Windows into a Dev Workstation with One PowerShell Script

Date:

Consumer Windows is tuned for a casual user: it sleeps mid-task, phones home with telemetry, and ships gaming services a developer never touches. If you run long automation, scraping pipelines, or Playwright jobs, a few settings changes make the machine stable and quiet. Here’s a single PowerShell script that applies them, and the safety steps to run it sanely.

The short answer: This PowerShell script tunes Windows 10/11 for development in five areas: power (no sleep, disk-off, or hibernation to interrupt long jobs), privacy/telemetry (advertising ID, activity history, tailored experiences off), developer ergonomics (long paths for Python, show file extensions and hidden files), network stability (no NIC power-down during scraping), and cleanup (disable Xbox services). Run it as Administrator after creating a restore point, and not on corporate, shared, or battery-dependent machines.

The point isn’t to strip Windows bare; it’s to stop the machine from interrupting long-running work and to surface the things developers actually need. It pairs with running a laptop as an always-on server: same instinct, applied to the whole workstation.

Consumer default vs dev-tuned workstationStop the interruptions; surface what developers need
Consumer default

Sleeps + powers down disk mid-task. Telemetry + ad-ID on. Xbox services running. Long paths off; extensions + hidden files hidden.

interrupts long jobs
Dev-tuned workstation

No sleep/disk-off/hibernate — long jobs run through. Telemetry off, Xbox off. Long paths ON for Python; extensions + hidden files shown.

What the script changes

Five groups of settings, each aimed at a specific developer pain:

  • Power: via powercfg, activates a high-performance plan and disables sleep, disk timeout, hibernation, and USB selective suspend, so a long scrape or build never gets suspended mid-run.
  • Privacy/telemetry: turns off the advertising ID, activity history, tailored experiences, location tracking, and feedback prompts, cutting background chatter and interruptions.
  • Developer ergonomics: enables long path support (Python and Node dependency trees routinely blow past the old 260-char limit), and shows file extensions and hidden files (so .env, .git, .vscode are visible).
  • Network stability: stops the network adapter from powering down, which otherwise drops long-lived connections during scraping or API polling.
  • Cleanup: disables the Xbox services a dev box never uses, trimming startup and background load.

The script

Save this as dev-workstation-setup.ps1:

Write-Host "Applying development workstation configuration..."

# --- POWER ---
powercfg -setactive SCHEME_MIN
powercfg /change standby-timeout-ac 0
powercfg /change standby-timeout-dc 0
powercfg /change monitor-timeout-ac 20
powercfg -change -disk-timeout-ac 0
powercfg -h off
powercfg -setacvalueindex scheme_current sub_usb usbselectivesuspend 0
powercfg -setactive scheme_current

# --- PRIVACY / TELEMETRY ---
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v PublishUserActivities /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Privacy" /v TailoredExperiencesWithDiagnosticDataEnabled /t REG_DWORD /d 0 /f

# --- DEVELOPER SETTINGS ---
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f

# --- NETWORK STABILITY ---
powercfg -setacvalueindex scheme_current sub_none netpowerdown 0
powercfg -setactive scheme_current

# --- CLEANUP: disable Xbox services ---
foreach ($svc in "XblAuthManager","XblGameSave","XboxNetApiSvc") {
    Stop-Service $svc -ErrorAction SilentlyContinue
    Set-Service  $svc -StartupType Disabled
}

Write-Host "Done. Restart for best results."
Code language: PowerShell (powershell)

How to run it safely

The safety steps aren’t optional, because this changes system settings:

  1. Create a restore point first: System Protection → Create Restore Point. This is your one-click undo.
  2. Open PowerShell as Administrator (Start → PowerShell → Run as Administrator).
  3. Allow the script for this session only: Set-ExecutionPolicy RemoteSigned -Scope Process. Without -Scope Process the change persists after you close the window.
  4. Run it: .\dev-workstation-setup.ps1, then restart.

Create the restore point before you run anything — it’s the one-click undo for every change here.

Where NOT to run it

This is for a personal development machine. Don’t run it on:

  • Corporate / managed machines: it may violate IT policy and fight group policy.
  • Shared computers: it changes privacy and service settings for everyone.
  • Gaming PCs: it disables Xbox services.
  • Battery-dependent laptops: disabling sleep will drain the battery; keep this for mains-powered or always-on machines (the laptop-as-a-server case).

Great on your own plugged-in dev box; wrong on a corporate laptop or a machine you share — know which you have.

The short version

This PowerShell script turns consumer Windows into a stable dev/automation workstation: it disables sleep, disk-off and hibernation so long jobs run uninterrupted; turns off advertising ID, activity history and tailored experiences; enables long paths for Python and shows file extensions and hidden files; stops the network adapter powering down; and disables Xbox services. Create a restore point, run it as Administrator with Set-ExecutionPolicy RemoteSigned -Scope Process, then restart. Use it only on a personal, plugged-in machine, never a corporate, shared, or battery-dependent one.

Frequently Asked Questions

Does it work on Windows 11?

Mostly. The power, privacy and developer settings apply the same way; a few registry paths differ slightly between versions, so review the output and confirm the developer settings (long paths, show extensions) took effect.

What if Create Restore Point is greyed out?

System Protection is switched off for the system drive, which is common on new installs. In the System Protection tab, select the C: drive, click Configure, turn protection on and give it some disk space. Then create the restore point before you run the script.

Does enabling long paths fix git as well?

Not on its own. Git for Windows has its own setting, so also run git config --global core.longpaths true. Without it, cloning or checking out a repo with deeply nested folders can still fail with “Filename too long”.

Can these changes be reversed?

Yes. Roll back with the restore point you created, or reverse individually: re-enable sleep in power settings, flip the registry values back, and set the Xbox services to start again with Set-Service <name> -StartupType Manual, their default. Nothing here is destructive or permanent.

Share post:

Subscribe

Popular

More like this
Related

WooCommerce Search by SKU or ISBN Finds Nothing? It Never Looks There

A shopper types the SKU from your catalog, or the ISBN printed on the back of a book, and gets "No products were found". The product is right there, and the number is on its page. Search simply never reads that part of the product.

Computer Slow but CPU and Memory Look Normal? Check the Handle Count

Chrome takes a minute to open, or doesn't open at all. Every click waits. You open Task Manager expecting to find the culprit, and it tells you everything is fine. Here is the number that isn't, and the fix that takes two minutes.

Kernel-Power 41 Tells You Your PC Restarted, Not Why

Your PC restarts with no blue screen, and the only clue is a critical event saying it didn't shut down cleanly. Here is how to get from that event to a short list of suspects.

Set Up WordPress SMTP Without a Plugin, Even on a Multisite Network

WordPress mail goes out as wordpress@ your domain, from the web server, and lands in spam. An SMTP plugin fixes that. So do about twenty lines of code, and on a network of sites the code can give every site its own mailbox and its own password.