Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureDataDisk

Get-AzureDataDisk

microsoft.windowsazure.commands.servicemanagement.dll

Synopsis

Gets a Microsoft Azure data disk object.

Syntax

Get-AzureDataDisk [-Lun] [-VM] [<CommonParameters>]

Detailed Description

The Get-AzureDataDisk cmdlet gets an object that represents the Microsoft Azure data disks on the specified virtual machine. To get a specific data disk object, specify the disk's LUN.

Parameters

-Lun <Nullable`1[Int32]>

Specifies the LUN where the data disk resides.

Aliases

None

Required?

false

Position

0

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-VM <IPersistentVM>

Specifies the virtual machine object from which to get data disk objects.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- Example 1 --------------------------

This command gets the "MyVM" virtual machine running on the "myservice" cloud service, and then gets a list of the data disks mounted on the virtual machine.

PS C:\> C:\PS>Get-AzureVM "myservice" –Name "MyVM" | Get-AzureDataDisk

-------------------------- Example 2 --------------------------

This command gets a data disk object, $dDisk, that represents the data disk mounted at LUN 2 on the Database virtual machine running on the Microsoft Azure service "myservice".

PS C:\> C:\PS>$dDisk = ( Get-AzureVM "myservice" -Name "MyVM" `
          | Get-AzureDataDisk -LUN 2 )

-------------------------- Example 3 --------------------------

This command removes the data disk at LUN 1 on the "MyVM" virtual machine running on the Microsoft Azure service "MyService".

PS C:\> C:\PS>Get-AzureVM "MyService" –Name "MyVM" | Get-AzureDataDisk –LUN 1

Get-AzureVM
Add-AzureDataDisk
Set-AzureDataDisk
Remove-AzureDataDisk