Save-AzureVhd

Enables download of .vhd images.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Save-AzureVhd
    [-Source] <Uri>
    [-LocalFilePath] <FileInfo>
    [[-NumberOfThreads] <Int32>]
    [[-StorageKey] <String>]
    [-OverWrite]
    [-Profile <AzureSMProfile>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

Description

The Save-AzureVhd cmdlet enables download of .vhd images from a blob where they are stored to a file. It has parameters to configure the download process by specifying the number of downloader threads that are used or overwriting the file which already exists in the specified file path.

Save-AzureVhd does not do any VHD format conversion and the blob is downloaded as it is.

Examples

Example 1: Download a VHD file

PS C:\> Save-AzureVhd -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd"

This command downloads a .vhd file.

Example 2: Download a VHD file and overwrite the local file

PS C:\> Save-AzureVhd -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -Overwrite

This command downloads a .vhd file and overwrites any file in the destination path.

Example 3: Download a VHD file and specify the number of threads

PS C:\> Save-AzureVhd -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -NumberOfThreads 32

This command downloads a .vhd file and specifies the number of threads.

Example 4: Download a VHD file and specify the storage key

PS C:\> Save-AzureVhd -Source "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\Win7Image.vhd" -StorageKey "zNvcH0r5vAGmC5AbwEtpcyWCMyBd3eMDbdaa4ua6kwxq6vTZH3Y+sw=="

This command downloads a .vhd file and specifies the storage key.

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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

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

-LocalFilePath

Specifies the local file path.

Type:FileInfo
Aliases:lf
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NumberOfThreads

Specifies the number of download threads that this cmdlet uses during download.

Type:Int32
Aliases:th
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OverWrite

Specifies that this cmdlet deletes the file specified by LocalFilePath file if it exists.

Type:SwitchParameter
Aliases:o
Position:5
Default value:None
Required:False
Accept pipeline input:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Source

Specifies the Uniform Resource Identifier (URI) to the blob in Azure.

Type:Uri
Aliases:src
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StorageKey

Specifies the storage key of the blob storage account. If it is not provided, Save-AzureVhd attempts to determine the storage key of the account in SourceUri from Azure.

Type:String
Aliases:sk
Position:4
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False