Save-AzureVhd

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Save-AzureVhd

Downloads VHDs from a blob to a file.

Parameter Set: Vhd
Save-AzureVhd [-Source] <Uri> [-LocalFilePath] <FileInfo> [[-NumberOfThreads] <Int32> ] [[-StorageKey] <String> ] [[-OverWrite]] [ <CommonParameters>]

This topic describes the cmdlet in the .6.19 version of the Windows Azure PowerShell module. To find out the version of the module you're using, from the Windows Azure PowerShell console, type (get-module azure).version.

The Save-AzureVhd cmdlet downloads VHD images stored in a blob to a file. The cmdlet includes parameters to configure the download process, such as the number of downloader threads to be used, or overwriting of an existing file. Save-AzureVhd does not perform any VHD format conversion; the blob is downloaded as is.

-LocalFilePath<FileInfo>

Specifies the path to save the VHD.

Aliases

lf

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NumberOfThreads<Int32>

Specifies the number of download threads to be used during download. The default is 8 if no value is specified.

Aliases

th

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OverWrite

Specifies that you want to delete an existing file, if one exists as specified by local file path.

Aliases

o

Required?

false

Position?

6

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Source<Uri>

Specifies the URI to the blob in Windows Azure.

Aliases

src

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-StorageKey<String>

Specifies the storage key of the blob storage account. If it is not provided, the cmdlet tries to determine the storage key of the account in the Source URI from Windows Azure.

Aliases

sk

Required?

false

Position?

5

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (https://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.

Example 1

This example downloads the specified blob to the specified local file path.

PS C:\> Save-AzureVhd -Source https://mytestaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd -LocalFilePath C:\vhd\MyWin7Image.vhd

Example 2

This example downloads the specified blob to the specified local file path and overwrites the existing file, if present.

PS C:\> Save-AzureVhd -Source https://mytestaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd -LocalFilePath C:\vhd\MyWin7Image.vhd -Overwrite

Example 3

This example downloads the specified blob and overrides the default number of threads by specifiying 32 threads.

PS C:\> Save-AzureVhd -Source https://mytestaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd -LocalFilePath C:\vhd\MyWin7Image.vhd -NumberOfThreads 32

Example 4

This example provides the storage key to use for the download.

PS C:\> Save-AzureVhd -Source https://mytestaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd -LocalFilePath C:\vhd\MyWin7Image.vhd -StorageKey zNvcH0r5vAGmC5AbwEtpcyWCMyBd3eMDbdaa4ua6kwxq6vTZH3Y+sw==

Get-AzureStorageAccount

Get-AzureStorageKey