Get-​Azure​Data​Disk

Gets Azure data disks.

Syntax

Get-AzureDataDisk
   [[-Lun] <Int32>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-Profile <AzureSMProfile>]
   -VM <IPersistentVM>
   [<CommonParameters>]

Description

The Get-AzureDataDisk cmdlet gets an object that represents the data disks on an Azure virtual machine. To get a specific data disk object, specify the logical unit number (LUN) of the disk.

Examples

Example 1: Get all data disks for a virtual machine

PS C:\> Get-AzureVM "ContosoService" -Name "VirtualMachine07" | Get-AzureDataDisk

This command gets the virtual machine named VirtualMachine07 in the service named ContosoService by using the Get-AzureVM cmdlet. The command passes the virtual machine to the current cmdlet by using the pipeline operator. The current cmdlet gets all the data disks for this virtual machine.

Example 2: Get a specific data disk for a vituralvirtual machinevirtual

PS C:\> Get-AzureVM "ContosoService" -Name "VirtualMachine07" | Get-AzureDataDisk -LUN 2

This command gets the virtual machine named VirtualMachine07 in the service named ContosoService. The command passes the virtual machine to the current cmdlet. The current cmdlet gets the data disk that has the LUN 2.

Required Parameters

-VM

Specifies the virtual machine object for which this cmdlet gets data disks. To obtain a virtual machine object, use the Get-AzureVM cmdlet.

Type:IPersistentVM
Aliases:InputObject
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Lun

Specifies the LUN for the data drive in the virtual machine. Valid values are: 0 through 15.

Type:Int32
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Profile

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

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