< Back

New-AzureQuickVM

Wed Jan 30, 2019 5:48 pm

NAME New-AzureQuickVM



SYNOPSIS

Configures and creates an Azure virtual machine.





SYNTAX

New-AzureQuickVM -Windows -ServiceName <String> [-Name <String>] -ImageName <String> [-Password <String>] [-ReverseDnsFqdn <String>] [-Location

<String>] [-AffinityGroup <String>] [-AdminUsername <String>] [-Certificates <CertificateSettingList>] [-WaitForBoot] [-DisableWinRMHttps]

[-EnableWinRMHttp] [-WinRMCertificate <X509Certificate2>] [-X509Certificates <X509Certificate2[]>] [-NoExportPrivateKey] [-NoWinRMEndpoint] [-VNetName

<String>] [-SubnetNames <String[]>] [-DnsSettings <DnsServer[]>] [-HostCaching <String>] [-AvailabilitySetName <String>] [-InstanceSize <String>]

[-MediaLocation <String>] [-DisableGuestAgent] [-CustomDataFile <String>] [-ReservedIPName <String>] [-Profile <AzureSMProfile>] [-InformationAction

<ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]



New-AzureQuickVM -ServiceName <String> [-Name <String>] -ImageName <String> [-Password <String>] [-ReverseDnsFqdn <String>] [-Location <String>]

[-AffinityGroup <String>] [-WaitForBoot] [-VNetName <String>] [-SubnetNames <String[]>] [-DnsSettings <DnsServer[]>] [-HostCaching <String>]

[-AvailabilitySetName <String>] [-InstanceSize <String>] [-MediaLocation <String>] [-DisableGuestAgent] [-CustomDataFile <String>] [-ReservedIPName

<String>] [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] -Linux [-LinuxUser <String>]

[-SSHPublicKeys <LinuxProvisioningConfigurationSet+SSHPublicKeyList>] [-SSHKeyPairs <LinuxProvisioningConfigurationSet+SSHKeyPairList>]

[<CommonParameters>]





DESCRIPTION

The New-AzureQuickVM cmdlet configures and creates an Azure virtual machine. This cmdlet can deploy a virtual machine into an existing Azure service.

This cmdlet can alternatively create an Azure service that hosts the new virtual machine.





PARAMETERS

-Windows [<SwitchParameter>]

Indicates that this cmdlet creates a Windows virtual machine.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-ServiceName <String>

Specifies the name of a new or existing Azure service to which this cmdlet adds the new virtual machine.



If you specify a new service, this cmdlets creates it. To create a new service, you must specify the Location or AffinityGroup parameter.



If you specify an existing service, do not specify Location or AffinityGroup.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the virtual machine that this cmdlet creates.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ImageName <String>

Specifies the name of the disk image this cmdlet uses to create the operating system disk.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Password <String>

Specifies the password for the administrative account.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReverseDnsFqdn <String>

Specifies the fully qualified domain name for reverse DNS look up.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Location <String>

Specifies the Azure datacenter that hosts the virtual machine. If you specify this parameter, the cmdlet creates an Azure service in the specified

location. Specify this parameter or the AffinityGroup parameter only if this cmdlet creates an Azure service for the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AffinityGroup <String>

Specifies the affinity group for the virtual machine. Specify this parameter or the Location parameter only if this cmdlet creates an Azure service

for the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AdminUsername <String>

Specifies the user name of the Administrator account that this cmdlet creates on the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Certificates <CertificateSettingList>

Specifies a list of certificates that this cmdlet uses to create the service.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WaitForBoot [<SwitchParameter>]

Indicates that this cmdlet waits for the virtual machine to reach the state ReadyRole. If the virtual machine reaches one of the following states,

the cmdlet fails: FailedStartingVM, ProvisioningFailed, or ProvisioningTimeout.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DisableWinRMHttps [<SwitchParameter>]

Indicates that this cmdlet disables Windows Remote Management (WinRM) on HTTPS. By default, WinRM is enabled over HTTPS.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-EnableWinRMHttp [<SwitchParameter>]

Indicates that this cmdlet enables WinRM over HTTP.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WinRMCertificate <X509Certificate2>

Specifies a certificate that this cmdlet associates to a WinRM endpoint.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-X509Certificates <X509Certificate2[]>

Specifies an array of X509 certificates that are deployed to a hosted service.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NoExportPrivateKey [<SwitchParameter>]

Indicates that this configuration does not upload the private key.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-NoWinRMEndpoint [<SwitchParameter>]

Indicates that this cmdlet does not add a WinRM endpoint for the virtual machine.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-VNetName <String>

Specifies the name of a virtual network for the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SubnetNames <String[]>

Specifies an array of names of subnet for the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DnsSettings <DnsServer[]>

Specifies an array of DNS server objects that defines the DNS settings for the new deployment. To create a DnsServer object, use the New-AzureDns

cmdlet.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HostCaching <String>

Specifies the host caching mode for the operating system disk. Valid values are:



-- ReadOnly



-- ReadWrite



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AvailabilitySetName <String>

Specifies the name of the availability set in which this cmdlet creates the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InstanceSize <String>

Specifies the size of the instance. Valid values are:



-- ExtraSmall



-- Small



-- Medium



-- Large



-- ExtraLarge



-- A5



-- A6



-- A7



-- A8



-- A9



-- Basic_A0



-- Basic_A1



-- Basic_A2



-- Basic_A3



-- Basic_A4



-- Standard_D1



-- Standard_D2



-- Standard_D3



-- Standard_D4



-- Standard_D11



-- Standard_D12



-- Standard_D13



-- Standard_D14



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-MediaLocation <String>

Specifies the Azure Storage location where this cmdlet creates the virtual machines disks.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DisableGuestAgent [<SwitchParameter>]

Indicates that this cmdlet disables the infrastructure as a service (IaaS) provision guest agent.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-CustomDataFile <String>

Specifies a data file for the virtual machine. This cmdlet encodes the contents of the file as Base64. The file must be less than 64 kilobytes long.



If the guest operating system is the Windows operating system, this cmdlet saves this data as a binary file that is named

%SYSTEMDRIVE%\\AzureData\\CustomData.bin.



If the guest operating system is Linux, this cmdlet passes the data by using the ovf-env.xml file. Installation copies that file to the

/var/lib/waagent directory. The agent also stores the Base64 encoded data in /var/lib/waagent/CustomData.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReservedIPName <String>

Specifies the reserved IP name.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Linux [<SwitchParameter>]

Indicates that this cmdlet creates a Linux based virtual machine.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-LinuxUser <String>

Specifies the user name of the Linux administrative account that this cmdlet creates on the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SSHPublicKeys <LinuxProvisioningConfigurationSet+SSHPublicKeyList>

Specifies SSH public keys.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SSHKeyPairs <LinuxProvisioningConfigurationSet+SSHKeyPairList>

Specifies SSH key pairs.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Create a virtual machine --------------------------



PS C:\\>New-AzureQuickVM -Windows -ServiceName "ContosoService17" -Name "VirutalMachine01" -ImageName "Image07" -Password "password" -AdminUsername

"AdminMain" -WaitForBoot



This command creates a virtual machine that runs the Windows operating system in an existing service. The cmdlet bases the virtual machine on the

specified image. The command specifies the WaitForBoot parameter. Therefore, the cmdlet waits for the virtual machine to start.

-------------------------- Example 2: Create a virtual machine that by using certificates --------------------------



PS C:\\>$certs = Get-ChildItem Cert:\\CurrentUser\\My

PS C:\\> New-AzureQuickVM -Windows -ServiceName "MySvc1" -name "MyWinVM1" -ImageName "Image07" -Password "password" -AdminUserName "AdminMain"

-WinRMCertificate $certs[0] -X509Certificates $certs[1], $certs[2] -WaitForBoot



The first command gets certificates from a store, and stores them in the $certs variable.

-------------------------- Example 3: Create a virtual machine that runs the Linux operating system --------------------------



PS C:\\>New-AzureQuickVM -Linux -ServiceName "ContosoServiceLinux01" -Name "LinuxVirtualMachine01" -ImageName "LinuxImage01" -LinuxUser "RootMain"

-Password "password" -Location "Central US"



This command creates a virtual machine that runs the Linux operating system from an image. This command creates a service to host the new virtual

machine. The command specifies a location for the service.

-------------------------- Example 4: Create a virtual machine and create a service to host the new virtual machine --------------------------



PS C:\\>$Locations = Get-AzureLocation

PS C:\\> $Images = Get-AzureVMImage

PS C:\\> New-AzureQuickVM -Windows -InstanceSize "Large" -ServiceName "ContosoService03" -Name " VirtualMachine25" -ImageName $images[4].imagename

-Password "password" -AdminUsername "AdminMain" -Location $Locations[0].name



The first command gets locations by using the Get-AzureLocation cmdlet, and then stores them in the $Locations array variable.

-------------------------- Example 5: Create a virtual machine that has a reserved IP name --------------------------



PS C:\\>$Locations = Get-AzureLocation

PS C:\\> $Images = Get-AzureVMImage

PS C:\\> New-AzureQuickVM -Windows -InstanceSize "Large" -ServiceName "ContosoService04" -Name "VirtualMachine27" -ImageName $Images[4].imagename

-Password "password" -AdminUsername "AdminMain" -Location $Locations[0].name -ReservedIPName $ipName



The first command gets locations, and then stores them in the $Locations array variable.



RELATED LINKS

Get-AzureLocation

Get-AzureVMImage

New-AzureDns