Get-AzStackHCIVMVirtualMachine

Gets a virtual machine

Syntax

Get-AzStackHCIVMVirtualMachine
   [-SubscriptionId <String>]
   [-DefaultProfile <PSObject>]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzStackHCIVMVirtualMachine
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-DefaultProfile <PSObject>]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzStackHCIVMVirtualMachine
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-DefaultProfile <PSObject>]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzStackHCIVMVirtualMachine
   -ResourceId <String>
   [-DefaultProfile <PSObject>]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Gets a virtual machine

Examples

Example 2: Get a Virtual Machine.

Get-AzStackHCIVMVirtualMachine -Name "testVm" -ResourceGroupName "test-rg"

Name            ResourceGroupName
----            -----------------
testVm          test-rg

This commnad gets a virtual machine in a specified resource group.

Example 2: List Virtual Machines in a Resource Group

Get-AzStackHCIVMVirtualMachine -ResourceGroupName "test-rg"

Name            ResourceGroupName
----            -----------------
testVm          test-rg

This command lists all virtual machines in a resource group.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of the virtual machine

Type:String
Aliases:VirtualMachineName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

The ARM ID of the virtual machine.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IVirtualMachineInstance

Machine