Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions prepare_vm_disks.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

# The MIT License (MIT)
#
# Copyright (c) 2015 Microsoft Azure
Expand Down Expand Up @@ -28,7 +26,15 @@ $letters = 83..89 | ForEach-Object { [char]$_ }
$count = 0
$label = "datadisk"

for($index = 2; $index -lt $disks.Count; $index++) {
[Array]$initializedDisks = Get-Disk | where { $_.PartitionStyle -ne 'Raw' }

if ($initializedDisks.Count -eq 1) {
$indexStart = 1
} else {
$indexStart = 2
}

for ($index = $indexStart; $index -lt $disks.Count; $index++) {
$driveLetter = $letters[$count].ToString()
if ($disks[$index].partitionstyle -eq 'raw') {
$disks[$index] | Initialize-Disk -PartitionStyle MBR -PassThru |
Expand Down