external help file | Module Name | ms.assetid | online version | schema |
---|---|---|---|---|
Microsoft.Azure.PowerShell.Cmdlets.Storage.dll-Help.xml |
Az.Storage |
6420CBE1-BF9D-493D-BCA8-E8C6688FAF3B |
2.0.0 |
Downloads the contents of a file.
Get-AzStorageFileContent [-ShareName] <String> [-Path] <String> [[-Destination] <String>] [-CheckMd5]
[-PassThru] [-Force] [-AsJob] [-DisAllowTrailingDot] [-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
[-WhatIf] [-Confirm] [-PreserveSMBAttribute] [<CommonParameters>]
Get-AzStorageFileContent [-Share] <CloudFileShare> [-ShareClient <ShareClient>] [-Path] <String>
[[-Destination] <String>] [-CheckMd5] [-PassThru] [-Force] [-AsJob] [-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
[-WhatIf] [-Confirm] [-PreserveSMBAttribute] [<CommonParameters>]
Get-AzStorageFileContent [-Directory] <CloudFileDirectory> [-ShareDirectoryClient <ShareDirectoryClient>]
[-Path] <String> [[-Destination] <String>] [-CheckMd5] [-PassThru] [-Force] [-AsJob]
[-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
[-WhatIf] [-Confirm] [-PreserveSMBAttribute] [<CommonParameters>]
Get-AzStorageFileContent [-File] <CloudFile> [-ShareFileClient <ShareFileClient>] [[-Destination] <String>]
[-CheckMd5] [-PassThru] [-Force] [-AsJob] [-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>] [-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
[-WhatIf] [-Confirm] [-PreserveSMBAttribute] [<CommonParameters>]
The Get-AzStorageFileContent cmdlet downloads the contents of a file, and then saves it to a destination that you specify. This cmdlet does not return the contents of the file.
Get-AzStorageFileContent -ShareName "ContosoShare06" -Path "ContosoWorkingFolder/CurrentDataFile"
This command downloads a file that is named CurrentDataFile in the folder ContosoWorkingFolder from the file share ContosoShare06 to current folder.
Get-AzStorageFile -ShareName sample | Where-Object {$_.GetType().Name -eq "CloudFile"} | Get-AzStorageFileContent
This example downloads the files under sample file share
Example 3: Download an Azure file to a local file, and perserve the Azure File SMB properties (File Attributtes, File Creation Time, File Last Write Time) in the local file.
Get-AzStorageFileContent -ShareName sample -Path "dir1/file1" -Destination $localFilePath -PreserveSMBAttribute
This example downloads an Azure file to a local file, and perserves the Azure File SMB properties (File Attributtes, File Creation Time, File Last Write Time) in the local file.
Run cmdlet in the background.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies whether to check the Md5 sum for the downloaded file.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the client-side time-out interval, in seconds, for one service request. If the previous call fails in the specified interval, this cmdlet retries the request. If this cmdlet does not receive a successful response before the interval elapses, this cmdlet returns an error.
Type: System.Nullable`1[System.Int32]
Parameter Sets: (All)
Aliases: ClientTimeoutPerRequestInSeconds
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the maximum concurrent network calls. You can use this parameter to limit the concurrency to throttle local CPU and bandwidth usage by specifying the maximum number of concurrent network calls. The specified value is an absolute count and is not multiplied by the core count. This parameter can help reduce network connection problems in low bandwidth environments, such as 100 kilobits per second. The default value is 10.
Type: System.Nullable`1[System.Int32]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies an Azure Storage context. To obtain a context, use the New-AzStorageContext cmdlet.
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
The credentials, account, tenant, and subscription used for communication with Azure.
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzureRmContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the destination path. This cmdlet downloads the file contents to the location that this parameter specifies. If you specify the path of a file that does not exist, this cmdlet creates that file, and saves the contents in the new file. If you specify a path of a file that already exists and you specify the Force parameter, the cmdlet overwrites the file. If you specify a path of an existing file and you do not specify Force, the cmdlet prompts you before it continues. If you specify the path of a folder, this cmdlet attempts to create a file that has the name of the Azure storage file.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies a folder as a CloudFileDirectory object. This cmdlet gets content for a file in the folder that this parameter specifies. To obtain a directory, use the New-AzStorageDirectory cmdlet. You can also use the Get-AzStorageFile cmdlet to obtain a directory.
Type: Microsoft.Azure.Storage.File.CloudFileDirectory
Parameter Sets: Directory
Aliases: CloudFileDirectory
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Disallow trailing dot (.) to suffix directory and file names.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: ShareName
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies a file as a CloudFile object. This cmdlet gets the file that this parameter specifies. To obtain a CloudFile object, use the Get-AzStorageFile cmdlet.
Type: Microsoft.Azure.Storage.File.CloudFile
Parameter Sets: File
Aliases: CloudFile
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
If you specify the path of a file that does not exist, this cmdlet creates that file, and saves the contents in the new file. If you specify a path of a file that already exists and you specify the Force parameter, the cmdlet overwrites the file. If you specify a path of an existing file and you do not specify Force, the cmdlet prompts you before it continues. If you specify the path of a folder, this cmdlet attempts to create a file that has the name of the Azure storage file.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Indicates that this cmdlet returns the AzureStorageFile object that it downloads.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the path of a file. This cmdlet gets the contents the file that this parameter specifies. If the file does not exist, this cmdlet returns an error.
Type: System.String
Parameter Sets: ShareName, Share, Directory
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Keep the source File SMB properties (File Attributtes, File Creation Time, File Last Write Time) in destination File. This parameter is only available on Windows.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the service side time-out interval, in seconds, for a request. If the specified interval elapses before the service processes the request, the storage service returns an error.
Type: System.Nullable`1[System.Int32]
Parameter Sets: (All)
Aliases: ServerTimeoutPerRequestInSeconds
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies a CloudFileShare object. This cmdlet downloads the contents of the file in the share this parameter specifies. To obtain a CloudFileShare object, use the Get-AzStorageShare cmdlet. This object contains the storage context. If you specify this parameter, do not specify the Context parameter.
Type: Microsoft.Azure.Storage.File.CloudFileShare
Parameter Sets: Share
Aliases: CloudFileShare
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
CloudFileShare object indicated the share where the file would be downloaded.
Type: Azure.Storage.Files.Shares.ShareClient
Parameter Sets: Share
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
ShareDirectoryClient object indicated the cloud directory where the file would be downloaded.
Type: Azure.Storage.Files.Shares.ShareDirectoryClient
Parameter Sets: Directory
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
ShareFileClient object indicated the cloud file to be downloaded.
Type: Azure.Storage.Files.Shares.ShareFileClient
Parameter Sets: File
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Specifies the name of the file share. This cmdlet downloads the contents of the file in the share this parameter specifies.
Type: System.String
Parameter Sets: ShareName
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.