Turn Windows into a Dev Workstation: 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 — 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: Set-ExecutionPolicy RemoteSigned.
  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, then restart — and only on a personal, plugged-in machine, never a corporate, shared, or battery-dependent one.

Frequently Asked Questions

Is this script safe for Windows 10?

Yes — it uses standard Windows commands (powercfg, reg add, service configuration) and changes settings only; it deletes no files. Still, create a System Restore point before running it so every change is one-click reversible.

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.

Will it affect gaming?

Yes — it disables the Xbox authentication, game-save and networking services. If you game on the same machine, skip the cleanup section or re-enable those services (Set-Service <name> -StartupType Automatic).

Why enable long paths?

Python, Node and similar toolchains create deeply nested dependency folders that exceed Windows’ legacy 260-character path limit, causing “path too long” errors. LongPathsEnabled = 1 removes that limit for modern apps — one of the highest-value developer settings here.

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 Automatic. Nothing here is destructive or permanent.

Share post:

Subscribe

Popular

More like this
Related

How to Merge Spreadsheets by URL (and Why Our Tool Reported 5 Misses That Weren’t)

Matching two spreadsheets on a URL column is the same job as matching a stock list to a price list by product code. It goes wrong in the same two places: how you clean the code, and how you count what didn't match.

Many-to-One: Why a Mapping Backlog Outgrows Its Target Taxonomy

You're mapping a messy source vocabulary onto a clean target taxonomy. The target has about 5,600 slots, so the job must be roughly 5,600 decisions — right? The backlog is already past 8,900, and still climbing.

The Fix That Didn’t Take: When a Content-Hash Gate Skips Your Code Change

You shipped a fix to how one field is computed, re-ran the pipeline across everything, and it reported a clean run. Then the consistency check still flags those records as wrong. The fix is in the code, the rebuild "ran" — and the records never changed. Your own optimisation skipped them.

Your Dedup Scan Is Over-Counting — Because It Forgot What You Already Fixed

The report said 80 duplicate groups still to resolve. You'd been resolving them for days. You run it again after a big batch and it *still* says 80-ish. The backlog isn't stubborn — the scan is counting work you already finished.