{"id":29768899,"url":"https://github.com/alertua/dev_drive_creation","last_synced_at":"2026-05-20T14:15:39.815Z","repository":{"id":306434669,"uuid":"1026166420","full_name":"ALERTua/dev_drive_creation","owner":"ALERTua","description":"Windows 11 Dev Drive Creation Script","archived":false,"fork":false,"pushed_at":"2025-07-25T12:57:38.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T19:07:44.019Z","etag":null,"topics":["dev-drive","powershell","powershell-script","windows-11"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ALERTua.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-25T12:22:27.000Z","updated_at":"2025-07-25T13:40:23.000Z","dependencies_parsed_at":"2025-07-25T19:07:53.248Z","dependency_job_id":"225752f3-7afa-4c75-ab28-076a65b0a4ff","html_url":"https://github.com/ALERTua/dev_drive_creation","commit_stats":null,"previous_names":["alertua/dev_drive_creation"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ALERTua/dev_drive_creation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALERTua%2Fdev_drive_creation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALERTua%2Fdev_drive_creation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALERTua%2Fdev_drive_creation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALERTua%2Fdev_drive_creation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ALERTua","download_url":"https://codeload.github.com/ALERTua/dev_drive_creation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALERTua%2Fdev_drive_creation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267294213,"owners_count":24065348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dev-drive","powershell","powershell-script","windows-11"],"created_at":"2025-07-27T03:35:13.483Z","updated_at":"2026-05-20T14:15:39.809Z","avatar_url":"https://github.com/ALERTua.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Windows 11 Dev Drive Creation Script\n\nAn interactive PowerShell script that guides users through creating Windows Dev Drives with customizable BitLocker encryption and ReFS deduplication settings.\n\n## Features\n\n- **Interactive Setup**: Step-by-step guided creation process\n- **Flexible Creation Methods**: Use free space or shrink existing drives\n- **Smart Drive Selection**: Shows detailed drive information for informed choices\n- **Optional BitLocker**: Choose encryption with automatic retry on password rejection\n- **Advanced Deduplication**: Configure deduplication with optional compression\n- **Compression Options**: Choose LZ4 or ZSTD with customizable compression levels\n- **Real Size Limits**: Shows actual Windows shrinkable limits, not estimates\n- **Power-Aware Scheduling**: Deduplication jobs run only on AC power to preserve battery\n- **Smart Defaults**: Press Enter for maximum sizes, sensible defaults throughout\n- **Robust Error Handling**: Comprehensive validation and user-friendly error messages\n\nhttps://github.com/user-attachments/assets/e5e97018-6966-4c64-8aaf-08764670f31f\n\n## Requirements\n\n- **Windows 11 26100 or newer**\n- **Administrator privileges** - Script must be run as administrator (elevated)\n\n## Basic Usage\n\n```powershell\n.\\dev_drive.ps1\n```\nThis script runs in interactive mode and will guide you through the entire Dev Drive creation process.\n\n**Important**: The script performs disk operations and must be run with administrator privileges. Right-click the script and select \"Run as administrator\" or use an elevated PowerShell session.\n\n### What the Interactive Process Includes:\n\n1. **Drive Selection**: Shows all physical drives with size and free space information\n2. **Creation Method**: Choose between using free space or shrinking an existing drive\n3. **Size Configuration**: Enter Dev Drive size (press Enter for maximum available)\n4. **BitLocker Setup**: Optional encryption with automatic password retry\n5. **Deduplication Options**: Choose deduplication level and compression settings\n6. **Compression Configuration**: Select format (LZ4/ZSTD) and level (1-9 for ZSTD)\n\n### Interactive Flow:\n\n```\nDev Drive creation script with BitLocker encryption and ReFS deduplication.\nWindows Build 26100 is OK\n\n=== GATHERING CONFIGURATION ===                                                                              \nLet's collect all the information needed to create your Dev Drive.\nNo changes will be made until you confirm the plan.\n                                                                                                             \n\nSelect the physical drive where you want to create your Dev Drive:                                           \n                                                                                                             \nDisk 0: Samsung SSD 990 PRO 1TB\n  Size: 931.51 GB\n  Free Space: 2.22 GB\n  Drives: C\n\nDisk 1: CT4000P3PSSD8\n  Size: 3726.02 GB\n  Free Space: 0.02 GB\n  Drives: D, V\n\n\n=== SELECT PHYSICAL DRIVE ===                                                                                \nEnter the disk number you want to use for Dev Drive creation:\nDisk number: 1\nSelected Disk 1: CT4000P3PSSD8\n\nChoose Dev Drive creation method:                                                                            \n1. Use UNALLOCATED FREE SPACE on a physical drive\n2. SHRINK an existing logical drive to create space\n3. Exit\n\nEnter your choice (1 or 2): 2\n\n=== SELECT DRIVE TO SHRINK ===                                                                               \nAvailable drives on Disk 1 for shrinking:\n  Drive D: ALERT\n    Total: 3613.28 GB | Free: 842.78 GB | Shrinkable: ~838 GB\n  Drive V: dev\n    Total: 112.69 GB | Free: 76.89 GB | Shrinkable: ~72 GB\nEnter drive letter to shrink: D\nSelected Drive D: ALERT (842.78 GB free)\nGetting Partition information...\nShrinkable size information:\n  Current partition size: 3613.28 GB                                                                         \n  Minimum partition size: 2796.92 GB                                                                         \n  Maximum shrinkable: 816.36 GB                                                                              \n                                                                                                             \nNote: Windows allows shrinking by the size of starting from the end of the drive disk space to the nearest written file block. Disk Fragmentation can affect this. If Windows does not allow for a drive to be shrunk, please use third-party tools (e.g. AOMEI).                                                                      \n                                                                                                             \nEnter amount to shrink in GB (max: 816.36 GB): 199                                                           \n                                                                                                             \nDo you want to enable BitLocker encryption for the Dev Drive?                                                \nBitLocker provides security but may impact performance.\n1. Yes, enable BitLocker encryption\n2. No, skip BitLocker encryption\n\nEnter your choice (1 or 2): 2\n\nDo you want to enable ReFS deduplication for the Dev Drive?                                                  \nDeduplication saves disk space by eliminating duplicate data.\n1. Yes, enable deduplication only (recommended for most users)\n2. Yes, enable deduplication + compression (configure compression settings)\n3. No, skip deduplication (maximum performance, less space savings)\n\nEnter your choice (1, 2 or 3): 2\n\nChoose compression format:                                                                                   \n1. LZ4: Fast compression with good balance of speed and compression ratio\n2. ZSTD: Better compression ratio but uses more CPU (allows custom compression level)\n\nEnter your choice (1 or 2): 2\n\nChoose ZSTD compression level (1-9):                                                                         \nLower levels (1-3): Faster compression, less CPU usage\nMedium levels (4-6): Balanced speed and compression\nHigher levels (7-9): Better compression, more CPU usage\n\nEnter compression level (1-9): 2\nSelected ZSTD compression with level 2\n\n\n===============================================================================\n                        DEV DRIVE CREATION PLAN\n===============================================================================\n\n* Shrink Drive D (ALERT) by 199 GB to free up space\n* Create 199 GB Dev Drive on Disk 1 (CT4000P3PSSD8) using ReFS\n* Enable ReFS deduplication with ZSTD compression (level 2)\n* Schedule daily optimization jobs at 11:00 and 17:00 (AC power only)\n* Schedule weekly maintenance job every Monday at 17:30\n* Mark Dev Drive as trusted for Windows Defender performance\n* Run initial optimization job to prepare the drive\n\n===============================================================================\n\nWARNING: This will make permanent changes to your disk configuration.                                        \n   Make sure you have backups of important data before proceeding.\n                                                                                                             \nAre you ready to proceed with Dev Drive creation? (yes/no): y\n\nStarting Dev Drive creation...                                                                               \nUsing previously retrieved partition information for drive D\nMaximum size for D: 3613.28 GB\nTarget size after shrinking: 3414.28 GB\nResizing Partition 2 of disk 1 to 3414.28 GB ...\nShrunk drive D by 199 GB\nCreating a new partition from the freed space on disk 1\nFormatting the newly created partition drive E: to a Dev Drive\n\nDev Drive created at E:\nMarking Dev Drive E: as trusted for Defender performance\nDev Drive marked trusted.\nSkipping BitLocker encryption as requested.\nEnabling Deduplication mode DedupAndCompress for E:\nEnabled ReFS Dedup mode: DedupAndCompress\nScheduling deduplication job at 11:00 (2h)\nScheduling deduplication job at 17:00 (2h)\nScheduled daily dedup jobs\nConfiguring deduplication tasks to run only on AC power...\nSuccessfully configured 1 deduplication task(s) to run only on AC power\nScheduling deduplication scrub jobs\nScheduled weekly scrub job on Monday at 12:00 (4h)\nRunning initial Deduplication Job for E:\nTriggered initial dedup job: Format=ZSTD, Level=2\nAll done. Dev Drive E: ready.\nDriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining   Size\n----------- ------------ -------------- --------- ------------ ----------------- -------------   ----\nE           DevDrive     ReFS           Fixed     Healthy      OK                    196.25 GB 199 GB\n\n```\n\n## What It Does\n\n### Interactive Dev Drive Creation Process:\n\n1. **Drive Discovery \u0026 Selection**\n   - Scans all physical drives and shows size, free space, and existing partitions\n   - User selects target physical drive for Dev Drive creation\n   - Displays real Windows partition limits (not estimates)\n\n2. **Creation Method Selection**\n   - **Free Space Mode**: Uses unallocated space on the selected drive\n   - **Shrink Mode**: Shrinks an existing logical drive to create space\n   - Shows available options based on selected drive\n\n3. **Size Configuration**\n   - Prompts for Dev Drive size with real limits shown\n   - Press Enter to use maximum available space\n   - Validates input against actual Windows constraints\n\n4. **Security Configuration**\n   - Optional BitLocker encryption with strong password requirements\n   - Automatic retry if password is rejected by BitLocker\n   - Azure AD backup for recovery keys\n\n5. **Storage Optimization Setup**\n   - Choose deduplication level (none, deduplication-only, or with compression)\n   - Select compression format (LZ4 for speed, ZSTD for better compression)\n   - Configure compression level (1-9 for ZSTD, affects CPU usage)\n   - Jobs automatically scheduled to run only on AC power\n\n6. **Dev Drive Creation \u0026 Setup**\n   - Creates ReFS-formatted Dev Drive with selected size\n   - Applies all chosen security and optimization settings\n   - Marks drive as trusted for Windows Defender performance\n   - Runs initial optimization job to prepare the drive\n\n### Advanced Features:\n\n- **Real-Time Validation**: Shows actual Windows limits, not estimates\n- **Smart Defaults**: Sensible defaults with easy override options\n- **Power Management**: Deduplication jobs only run on AC power\n- **Error Recovery**: Handles password rejection and API failures gracefully\n- **User-Friendly**: Clear prompts with helpful explanations throughout\n\n## Security Notes\n\n- Requires complex password (8+ chars, upper/lower/digit/special)\n- BitLocker recovery key backed up to Azure AD\n- Auto-unlock enabled for convenience\n- Drive marked as trusted for development workloads\n\n## Scheduled Jobs\n\nThe script creates two daily deduplication jobs that run **only on AC power**:\n- 11:00 AM (2 hours duration)\n- 5:00 PM (2 hours duration)\n\nJobs run Monday-Friday with 60% CPU limit to preserve battery life on laptops.\n\n## Troubleshooting\n\n- Ensure sufficient free space exists on the selected physical disk\n- Run as Administrator\n- Verify Azure AD connectivity for BitLocker backup\n- Check Dev Drive support on your Windows version\n\nMore on Dev Drive at https://learn.microsoft.com/en-us/windows/dev-drive/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falertua%2Fdev_drive_creation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falertua%2Fdev_drive_creation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falertua%2Fdev_drive_creation/lists"}