Creating Differencing VHD Doesn't work !

Jan 24, 2012 at 6:14 PM

hi friends

it is 3 days that i'm trying hard to make on 1 line powershell code , but that's making me crazy !!

i need a code that Creates a differencing VHD for Virtual machine but the VHD always is created as Dynamically Expanding ( and not differencing ) ( that's make me mad !)

here is my syntax :


$vm = "MyVM"

$VmAndVhdPath = "D:\MyFolder1\$vm"

new-vm -name $vm -path  $vmAndVhdpath

Add-VMNewHardDisk -VM $VM -controllerID 0 -lun 0 -parentvhd "D:\MyFolder2\win2008-diff.vhd" -VHDpath "$vmAndVhdpath\$vm.vhd" -force

command makes the VHD but from type of Dynamically Expanding ( and not differencing )  :-(   :-(

exponentially Grateful to someone who help me

thanks in advance