How to mount a DVD iso programatically with C# to Hyper-V VM

  • Thread starter Thread starter Zoltan Papp Hu
  • Start date Start date
Z

Zoltan Papp Hu

Guest
Can anybody share with me any easy sample about this topic?

I try it with PowerShell succesfully on a Server 2019 with VS2019 and C# but I need sample for native WMI version.

Or write me please any place where anybody can help me.

ManagementScope scope = new ManagementScope(@"root\virtualization\v2");
using (ManagementObject vm = WmiUtilities.GetVirtualMachine("teszt1", scope))
using (ManagementObject vssd = WmiUtilities.GetVirtualMachineSettings(vm))
using (ManagementObject vmms = WmiUtilities.GetVirtualMachineManagementService(scope))
{
...
}

Continue reading...
 
Back
Top