Skip to content

AzureRT S51 - Fix Start/Stop-AzureVM #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 14, 2015
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ function Run-StartAndStopMultipleVirtualMachinesTest
Start-AzureVM -ServiceName $svcName -VM $vmList[0];
Start-AzureVM -ServiceName $svcName -VM $vmList[0],$vmList[1];
Start-AzureVM -ServiceName $svcName -VM $vmList;
}
catch
{

}
finally
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ public static void SetTestSettings()

protected void StartTest(string testname, DateTime testStartTime)
{
Console.WriteLine("{0} test starts at {1}", testname, testStartTime);
string subId = defaultAzureSubscription.SubscriptionId;
string endPoint = defaultAzureSubscription.ServiceEndpoint;
Console.WriteLine("{0} test starts at {1} for subscription {2} and endpoint {3}", testname, testStartTime, subId, endPoint);
}

private static void Retry(string cmdlet, string message, int maxTry = 1, int intervalSecond = 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class StartAzureVMCommand : IaaSDeploymentManagementCmdletBase
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Virtual Machine to restart.", ParameterSetName = "Input")]
[ValidateNotNullOrEmpty]
[Alias("InputObject")]
public PersistentVM[] VM { get; set; }
public IPersistentVM[] VM { get; set; }

protected override void ExecuteCommand()
{
Expand All @@ -47,7 +47,7 @@ protected override void ExecuteCommand()
return;
}

string[] inputRoleNames = (this.ParameterSetName == "ByName") ? this.Name : this.VM.Select(vm => vm.RoleName).ToArray();
string[] inputRoleNames = (this.ParameterSetName == "ByName") ? this.Name : this.VM.Select(vm => vm.GetInstance().RoleName).ToArray();

// Generate a list of role names matching wildcard patterns or
// the exact name specified in the -Name parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class StopAzureVMCommand : IaaSDeploymentManagementCmdletBase
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Virtual Machine to restart.", ParameterSetName = "Input")]
[ValidateNotNullOrEmpty]
[Alias("InputObject")]
public Model.PersistentVM[] VM { get; set; }
public Model.IPersistentVM[] VM { get; set; }

[Parameter(Position = 2, HelpMessage = "Keeps the VM provisioned")]
public SwitchParameter StayProvisioned { get; set; }
Expand All @@ -54,7 +54,7 @@ protected override void ExecuteCommand()
return;
}

string[] inputRoleNames = (this.ParameterSetName == "ByName") ? this.Name : this.VM.Select(vm => vm.RoleName).ToArray();
string[] inputRoleNames = (this.ParameterSetName == "ByName") ? this.Name : this.VM.Select(vm => vm.GetInstance().RoleName).ToArray();

// Generate a list of role names matching regular expressions or
// the exact name specified in the -Name parameter.
Expand Down