wsp-10323 Convert the VSP provider into one utilizing PowerShell. Step 6 Create\Delete\Export

This commit is contained in:
AlexanderTr 2015-03-20 21:24:07 +03:00
parent 13ae446aa1
commit 8b3332e3c7
8 changed files with 121 additions and 401 deletions

View file

@ -47,7 +47,7 @@ namespace WebsitePanel.Providers.Virtualization
// Command cmd = new Command("Get-VM");
// Collection<PSObject> result = powerShell.Execute(cmd, false);
// Collection<PSObject> result = powerShell.Execute(cmd, true);
// if (result == null || result.Count == 0)
// return null;
@ -63,7 +63,7 @@ namespace WebsitePanel.Providers.Virtualization
Command cmd = new Command("Get-VMHardDiskDrive");
cmd.Parameters.Add("VMName", vmname);
return powerShell.Execute(cmd, false);
return powerShell.Execute(cmd, true);
}
public static void GetVirtualHardDiskDetail(PowerShellManager powerShell, string path, ref VirtualHardDiskInfo disk)
@ -72,7 +72,7 @@ namespace WebsitePanel.Providers.Virtualization
{
Command cmd = new Command("Get-VHD");
cmd.Parameters.Add("Path", path);
Collection<PSObject> result = powerShell.Execute(cmd, false);
Collection<PSObject> result = powerShell.Execute(cmd, true);
if (result != null && result.Count > 0)
{
disk.DiskFormat = result[0].GetEnum<VirtualHardDiskFormat>("VhdFormat");