New-AzureVMConfig

New-AzureVMConfig

Creates a configurable virtual machine object.

Syntax

Parameter Set: Default
New-AzureVMConfig [-VMName] <String> [-VMSize] <String> [[-AvailabilitySetId] <String> ] [-Profile <AzureProfile> ] [ <CommonParameters>]

Detailed Description

The New-AzureVMConfig cmdlet creates a configurable local virtual machine object for Azure. Configure a virtual machine object by using other cmdlets, such as Set-AzureVMOperatingSystem, Set-AzureVMSourceImage, Add-AzureVMNetworkInterface, and Set-AzureVMOSDisk.

Parameters

-AvailabilitySetId<String>

Specifies the ID of an availability set. To obtain an availability set object, use the Get-AzureAvailabilitySet cmdlet. The availability set object contains an ID property.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Profile<AzureProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMName<String>

Specifies a name for the virtual machine.

Aliases

ResourceName,Name

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-VMSize<String>

Specifies the size for the virtual machine.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Create a virtual machine object

The first command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the $AvailabilitySet variable.

The second command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet.

$AvailabilitySet = Get-AzureAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03"
PS C:\> $VirtualMachine = New-AzureVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id

New-AzureVM

Update-AzureVM

Set-AzureVMOperatingSystem

Set-AzureVMSourceImage

Get-AzureAvailabilitySet