Jul 7 2011 2:23PM GMT
Posted by: Richard Siddaway
Disks
Next partition
Posted by: Richard Siddaway
I also need to generate a partition number for Mount-VHD
Similar idea but use the Win32_DiskPartition class
function get-nextpartition { $disk = Get-WmiObject -Class Win32_DiskPartition | sort Index -Descending | select -First 1 -Property Index $nextindex = ($disk.Index) + 1 $nextindex }
The Index is an integer so we only need to add 1




