public static IResourceAllocationSettingData GetDefaultSyntheticDVDDrive(IComputerSystem host) { IResourcePool resource = ResourcePool.Query(host, "ResourceSubType = 'Microsoft:Hyper-V:Synthetic DVD Drive' and Primordial = True").FirstOrDefault <IResourcePool>(); Invariant.ArgumentNotNull((object)resource, "Synthetic DVD Drive not found"); using (resource) return(ResourceAllocationSettingData.GetDefaultFromResourcePool(resource)); }
public static IResourceAllocationSettingData GetDefaultEmulatedIDEController(IComputerSystem host) { IResourcePool resource = ResourcePool.Query(host, "ResourceSubType = 'Microsoft:Hyper-V:Emulated IDE Controller' and Primordial = True").FirstOrDefault <IResourcePool>(); Invariant.ArgumentNotNull((object)resource, "Emulated IDE Controller"); using (resource) return(ResourceAllocationSettingData.GetDefaultFromResourcePool(resource)); }