< Back

Save-AzureRmVhd

Tue Jan 29, 2019 9:39 pm

NAME Save-AzureRmVhd



SYNOPSIS

Saves downloaded .vhd images locally.





SYNTAX

Save-AzureRmVhd [-ResourceGroupName] <String> [-SourceUri] <Uri> [-LocalFilePath] <FileInfo> [[-NumberOfThreads] <Int32>] [[-OverWrite]] [-AsJob]

[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]



Save-AzureRmVhd [-StorageKey] <String> [-SourceUri] <Uri> [-LocalFilePath] <FileInfo> [[-NumberOfThreads] <Int32>] [[-OverWrite]] [-AsJob]

[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]





DESCRIPTION

The Save-AzureRmVhd cmdlet saves .vhd images from a blob where they are stored to a file. You can specify the number of downloader threads that

the process uses and whether to replace a file that already exists.



This cmdlet downloads content as it is. It does not apply any Virtual Hard Disk (VHD) format conversion.





PARAMETERS

-AsJob [<SwitchParameter>]

Run cmdlet in the background and return a Job to track progress.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LocalFilePath <FileInfo>

Specifies the local file path of the saved image.



Required? true

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NumberOfThreads <Int32>

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



Required? false

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-OverWrite [<SwitchParameter>]

Indicates that this cmdlet replaces the file specified by LocalFilePath file if it exists.



Required? false

Position? 4

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group of the storage account.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SourceUri <Uri>

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



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageKey <String>

Specifies the storage key of the blob storage account. If you do not specify a key, this cmdlet attempts to determine the storage key of the

account in SourceUri from Azure.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Compute.Models.VhdDownloadContext







NOTES









Example 1: Download an image



PS C:\\> Save-AzureRmVhd -SourceUri "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"

-ResourceGroupName "rgname"



This command downloads a .vhd file, and stores it in the local path C:\\vhd\\Win7Image.vhd.





Example 2: Download an image and overwrite the local file



PS C:\\> Save-AzureRmVhd -SourceUri "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"

-Overwrite -ResourceGroupName "rgname"



This command downloads a .vhd file, and stores it in the local path. The command includes the Overwrite parameter. Therefore, if

C:\\vhd\\Win7Image.vhd already exists, this command replaces it.





Example 3: Download an image by using a specified number of threads



PS C:\\> Save-AzureRmVhd -SourceUri "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"

-NumberOfThreads 32 -ResourceGroupName "rgname"



This command downloads a .vhd file, and stores it in the local path. The command specifies a value of 32 for the NumberOfThreads parameter.

Therefore, the cmdlet uses 32 threads for this action.





Example 4: Download an image and specify the storage key



PS C:\\> Save-AzureRmVhd -SourceUri "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"

-StorageKey "zNvcH0r5vAGmC5AbwEtpcyWCMyBd3eMDbdaa4ua6kwxq6vTZH3Y+sw==" -ResourceGroupName "rgname"



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







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... azurermvhd

Add-AzureRmVhd