Save-AzureVhd
Syntax
Save-AzureVhd
[-Source] <Uri>
[-LocalFilePath] <FileInfo>
[[-NumberOfThreads] <Int32>]
[[-StorageKey] <String>]
[-OverWrite]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[-Profile <AzureSMProfile>]
[<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.
Required Parameters
Specifies the local file path.
| Type: | FileInfo |
| Aliases: | lf |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the Uniform Resource Identifier (URI) to the blob in Azure.
| Type: | Uri |
| Aliases: | src |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Optional Parameters
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 |
Specifies an information variable.
| Type: | String |
| Aliases: | iv |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the number of download threads that this cmdlet uses during download.
| Type: | Int32 |
| Aliases: | th |
| Position: | 3 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that this cmdlet deletes the file specified by LocalFilePath file if it exists.
| Type: | SwitchParameter |
| Aliases: | o |
| Position: | 5 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
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 |
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 |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |