mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
resize disk using powershell
This commit is contained in:
@@ -128,11 +128,7 @@ if (Test-IsWin19) {
|
||||
}
|
||||
|
||||
# Expand disk size of OS drive
|
||||
New-Item -Path d:\ -Name cmds.txt -ItemType File -Force
|
||||
Add-Content -Path d:\cmds.txt "SELECT VOLUME=C`r`nEXTEND"
|
||||
|
||||
$expandResult = (diskpart /s 'd:\cmds.txt')
|
||||
Write-Host $expandResult
|
||||
|
||||
Write-Host "Disk sizes after expansion"
|
||||
wmic logicaldisk get size,freespace,caption
|
||||
$driveLetter = "C"
|
||||
$size = Get-PartitionSupportedSize -DriveLetter $driveLetter
|
||||
Resize-Partition -DriveLetter $driveLetter -Size $size.SizeMax
|
||||
Get-Partition | Select-Object DriveLetter, PartitionNumber, Size
|
||||
Reference in New Issue
Block a user