This script expands a Dev Drive (.vhdx) and resizes its partition to use the new space.
- Path:
C:\DevDrive\DEV.vhdx - Drive Letter:
D: - New Size:
160GB(change in script if needed)
- Open PowerShell as Administrator.
- Run:
Set-ExecutionPolicy Bypass -Scope Process -Force .\resize-dev-drive.ps1
3. Wait for the process to complete.
4. Your Dev Drive will now reflect the new size in File Explorer.
## β οΈ Notes
* You can only **increase**, not shrink, the `.vhdx`.
* Ensure no processes are using the Dev Drive before running.
* Adjust `$newSize` in the script if you want a different size.
## π§° Commands used
```powershell
Dismount-VHD -Path "C:\DevDrive\DEV.vhdx"
Resize-VHD -Path "C:\DevDrive\DEV.vhdx" -SizeBytes 160GB
Mount-VHD -Path "C:\DevDrive\DEV.vhdx"
Get-Partition -DriveLetter D | Resize-Partition -Size 160GB
```