xml version="1.0" encoding="utf-8"?>
<Settings>
<BootEntry Drive="C" Path="VHDsSP2010.VHD" Description="Boot To SP 2010 VHD" />
Settings>
The full PowerShell Script can be downloaded here. The following portions of the script do the heavy lifting.
First, the PowerShell script returns the values from the settings.xml file.
[System.Xml.XmlElement]$settings = Get-Settings $BootEntry = $settings.BootEntry $Drive = $BootEntry.Drive $Path = $BootEntry.Path $Description = $BootEntry.Description
$BootEntryCopy = bcdedit /copy '{current}' /d $BootEntry.Description
$CLSID = $BootEntryCopy | ForEach-Object {$_.Remove(0,37).Replace(".","")}
$VHD = 'vhd=[' + $Drive + ':]' + $Path
bcdedit /set $CLSID device $VHD bcdedit /set $CLSID osdevice $VHD bcdedit /set $CLSID detecthal on


