resize disk using powershell

This commit is contained in:
Aleksandr Chebotov
2020-10-19 10:25:04 +03:00
parent 941243a186
commit 27361ddb4a
2 changed files with 5 additions and 9 deletions

View File

@@ -128,11 +128,7 @@ if (Test-IsWin19) {
} }
# Expand disk size of OS drive # Expand disk size of OS drive
New-Item -Path d:\ -Name cmds.txt -ItemType File -Force $driveLetter = "C"
Add-Content -Path d:\cmds.txt "SELECT VOLUME=C`r`nEXTEND" $size = Get-PartitionSupportedSize -DriveLetter $driveLetter
Resize-Partition -DriveLetter $driveLetter -Size $size.SizeMax
$expandResult = (diskpart /s 'd:\cmds.txt') Get-Partition | Select-Object DriveLetter, PartitionNumber, Size
Write-Host $expandResult
Write-Host "Disk sizes after expansion"
wmic logicaldisk get size,freespace,caption

View File

@@ -13,7 +13,7 @@
"virtual_network_resource_group_name": "{{env `VNET_RESOURCE_GROUP`}}", "virtual_network_resource_group_name": "{{env `VNET_RESOURCE_GROUP`}}",
"virtual_network_subnet_name": "{{env `VNET_SUBNET`}}", "virtual_network_subnet_name": "{{env `VNET_SUBNET`}}",
"private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}", "private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}",
"vm_size": "Standard_D4_v2", "vm_size": "Standard_DS4_v2",
"run_scan_antivirus": "false", "run_scan_antivirus": "false",
"root_folder": "C:", "root_folder": "C:",
"toolset_json_path": "{{env `TEMP`}}\\toolset.json", "toolset_json_path": "{{env `TEMP`}}\\toolset.json",