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
Default (Default)
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
Parameter properties
Type: | ActionPreference |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | infa |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-InformationVariable
Specifies an information variable.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | iv |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-LocalFilePath
Specifies the local file path.
Parameter properties
Type: | FileInfo |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | lf |
Parameter sets
(All)
Position: | 2 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-NumberOfThreads
Specifies the number of download threads that this cmdlet uses during download.
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | th |
Parameter sets
(All)
Position: | 3 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-OverWrite
Specifies that this cmdlet deletes the file specified by LocalFilePath file if it exists.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | o |
Parameter sets
(All)
Position: | 5 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | 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.
Parameter properties
Type: | AzureSMProfile |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Source
Specifies the Uniform Resource Identifier (URI) to the blob in Azure
.
Parameter properties
Type: | Uri |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | src |
Parameter sets
(All)
Position: | 1 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | 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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | sk |
Parameter sets
(All)
Position: | 4 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.