Skip to content

Commit

Permalink
size
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Nov 30, 2017
1 parent 5d6cb34 commit 56a866a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public static ResourceConfig<VirtualMachine> CreateVirtualMachineConfig(
this ResourceConfig<ResourceGroup> resourceGroup,
string name,
ResourceConfig<NetworkInterface> networkInterface,
bool isWindows,
string adminUsername,
string adminPassword,
Image image)
Image image,
string size)
=> Strategy.CreateConfig(
resourceGroup,
name,
Expand All @@ -46,9 +48,8 @@ public static ResourceConfig<VirtualMachine> CreateVirtualMachineConfig(
OsProfile = new OSProfile
{
ComputerName = name,
WindowsConfiguration = new WindowsConfiguration
{
},
WindowsConfiguration = isWindows ? new WindowsConfiguration { } : null,
LinuxConfiguration = isWindows ? null : new LinuxConfiguration(),
AdminUsername = adminUsername,
AdminPassword = adminPassword,
},
Expand All @@ -64,7 +65,7 @@ public static ResourceConfig<VirtualMachine> CreateVirtualMachineConfig(
},
HardwareProfile = new HardwareProfile
{
VmSize = "Standard_DS1_v2"
VmSize = size
},
StorageProfile = new StorageProfile
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ public class NewAzureVMCommand : VirtualMachineBaseCmdlet
[Parameter(ParameterSetName = StrategyParameterSet, Mandatory = false)]
public string ImageName { get; set; } = "Win2016Datacenter";

[Parameter(ParameterSetName = StrategyParameterSet, Mandatory = false)]
public string Size { get; set; } = "Standard_DS1_v2";

public override void ExecuteCmdlet()
{
switch (ParameterSetName)
Expand Down Expand Up @@ -206,9 +209,11 @@ async Task StrategyExecuteCmdletAsync(IAsyncCmdlet asyncCmdlet)
var virtualMachine = resourceGroup.CreateVirtualMachineConfig(
name: Name,
networkInterface: networkInterface,
isWindows: isWindows,
adminUsername: Credential.UserName,
adminPassword: new NetworkCredential(string.Empty, Credential.Password).Password,
image: image.Image);
image: image.Image,
size: Size);

var client = new Client(DefaultProfile.DefaultContext);

Expand Down

0 comments on commit 56a866a

Please sign in to comment.