public Collection<DiskContext> GetAzureDisk()
 {
     GetAzureDiskCmdletInfo getAzureDiskCmdlet = new GetAzureDiskCmdletInfo((string) null);
     WindowsAzurePowershellCmdletSequence getAzureDisk = new WindowsAzurePowershellCmdletSequence();
     getAzureDisk.Add(getAzureDiskCmdlet);
     Collection<DiskContext> diskContext = new Collection<DiskContext>();
     foreach (PSObject result in getAzureDisk.Run())
     {
         diskContext.Add((DiskContext)result.BaseObject);
     }
     return diskContext;
 }
        public PersistentVMRoleContext NewAzureQuickVM(OS os, string name, string serviceName, string imageName, string password, string locationName)
        {
            NewAzureQuickVMCmdletInfo newAzureQuickVMCmdlet = new NewAzureQuickVMCmdletInfo(os, name, serviceName, imageName, password, locationName);
            WindowsAzurePowershellCmdletSequence sequence = new WindowsAzurePowershellCmdletSequence();

            SubscriptionData currentSubscription;
            if ((currentSubscription = GetCurrentAzureSubscription()) == null)
            {
                ImportAzurePublishSettingsFile();
                currentSubscription = GetCurrentAzureSubscription();
            }
            if (string.IsNullOrEmpty(currentSubscription.CurrentStorageAccount))
            {
                StorageServicePropertiesOperationContext storageAccount = NewAzureStorageAccount(Utilities.GetUniqueShortName("storage"), locationName);
                if (storageAccount != null)
                {
                    SetAzureSubscription(currentSubscription.SubscriptionName, storageAccount.StorageAccountName);
                    currentSubscription = GetCurrentAzureSubscription();
                }
            }
            if (!string.IsNullOrEmpty(currentSubscription.CurrentStorageAccount))
            {
                sequence.Add(newAzureQuickVMCmdlet);
                sequence.Run();
                return GetAzureVM(name, serviceName);
            }
            return null;
        }
 public void SaveAzureVMImage(string serviceName, string vmName, string newVmName, string newImageName, string postCaptureAction)
 {
     SaveAzureVMImageCmdletInfo saveAzureVMImageCmdlet = new SaveAzureVMImageCmdletInfo(serviceName, vmName, newVmName, newImageName, postCaptureAction);
     WindowsAzurePowershellCmdletSequence saveAzureVMImage = new WindowsAzurePowershellCmdletSequence();
     saveAzureVMImage.Add(saveAzureVMImageCmdlet);
     Collection<OSImageContext> osImageContext = new Collection<OSImageContext>();
 }
 public Collection<OSImageContext> GetAzureVMImage()
 {
     GetAzureVMImageCmdletInfo getAzureVMImageCmdlet = new GetAzureVMImageCmdletInfo();
     WindowsAzurePowershellCmdletSequence getAzureVMImage = new WindowsAzurePowershellCmdletSequence();
     getAzureVMImage.Add(getAzureVMImageCmdlet);
     Collection<OSImageContext> osImageContext = new Collection<OSImageContext>();
     foreach (PSObject result in getAzureVMImage.Run())
     {
         osImageContext.Add((OSImageContext)result.BaseObject);
     }
     return osImageContext;
 }