你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzStorageFileContent
下载文件的内容。
语法
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
[-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
[-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
[-ShareFileClient] <ShareFileClient>
[[-Destination] <String>]
[-CheckMd5]
[-PassThru]
[-Force]
[-AsJob]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[-PreserveSMBAttribute]
[<CommonParameters>]
说明
Get-AzStorageFileContent cmdlet 下载文件的内容,然后将其保存到指定的目标。 此 cmdlet 不返回文件的内容。
示例
示例 1:从文件夹下载文件
Get-AzStorageFileContent -ShareName "ContosoShare06" -Path "ContosoWorkingFolder/CurrentDataFile"
此命令将 ContosoWorkingFolder 文件夹中名为 CurrentDataFile 的文件从文件共享 ContosoShare06 下载到当前文件夹。
示例 2:下载示例文件共享下的文件
Get-AzStorageFile -ShareName sample | Where-Object {$_.GetType().Name -eq "AzureStorageFile"} | Get-AzStorageFileContent
此示例下载示例文件共享下的文件
示例 3:将 Azure 文件下载到本地文件,并在本地文件中保留 Azure 文件 SMB 属性(文件创建时间、文件创建时间、文件上次写入时间)。
Get-AzStorageFileContent -ShareName sample -Path "dir1/file1" -Destination $localFilePath -PreserveSMBAttribute
此示例将 Azure 文件下载到本地文件,并在本地文件中保留 Azure 文件 SMB 属性(文件创建时间、文件上次写入时间、文件上次写入时间)。
参数
-AsJob
在后台运行 cmdlet。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-CheckMd5
指定是否检查已下载文件的 Md5 总和。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ClientTimeoutPerRequest
指定一个服务请求的客户端超时间隔(以秒为单位)。 如果上一次调用在指定的时间间隔内失败,则此 cmdlet 将重试请求。 如果此 cmdlet 在间隔过前未收到成功的响应,则此 cmdlet 将返回错误。
类型: | Nullable<T>[Int32] |
别名: | ClientTimeoutPerRequestInSeconds |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ConcurrentTaskCount
指定最大并发网络调用数。 可以使用此参数通过指定并发网络调用的最大数目来限制本地 CPU 和带宽使用量的并发性。 指定的值是绝对计数,不乘以核心计数。 此参数可帮助减少低带宽环境中的网络连接问题,例如每秒 100 千比特。 默认值为 10。
类型: | Nullable<T>[Int32] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Context
指定 Azure 存储上下文。 若要获取上下文,请使用 New-AzStorageContext cmdlet。
类型: | IStorageContext |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Destination
指定目标路径。 此 cmdlet 会将文件内容下载到此参数指定的位置。 如果指定不存在的文件的路径,此 cmdlet 将创建该文件,并将内容保存在新文件中。 如果指定已存在的文件的路径,并且指定了 Force 参数,则 cmdlet 将覆盖该文件。 如果指定现有文件的路径,并且未指定 Force,则 cmdlet 会在继续之前提示你。 如果指定文件夹的路径,此 cmdlet 将尝试创建一个名称为 Azure 存储文件的文件。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DisAllowTrailingDot
禁止尾随点 (.) 后缀目录和文件名。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Force
如果指定不存在的文件的路径,此 cmdlet 将创建该文件,并将内容保存在新文件中。 如果指定已存在的文件的路径,并且指定了 Force 参数,则 cmdlet 将覆盖该文件。 如果指定现有文件的路径,并且未指定 Force,则 cmdlet 会在继续之前提示你。 如果指定文件夹的路径,此 cmdlet 将尝试创建一个名称为 Azure 存储文件的文件。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PassThru
指示此 cmdlet 返回其下载 AzureStorageFile 对象。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Path
指定文件的路径。 此 cmdlet 获取此参数指定的文件的内容。 如果文件不存在,则此 cmdlet 将返回错误。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-PreserveSMBAttribute
在目标文件中保留源文件 SMB 属性(文件创建时间、文件创建时间、文件上次写入时间)。 此参数仅在 Windows 上可用。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ServerTimeoutPerRequest
指定请求的服务端超时间隔(以秒为单位)。 如果服务处理请求之前指定的间隔已过,则存储服务将返回错误。
类型: | Nullable<T>[Int32] |
别名: | ServerTimeoutPerRequestInSeconds |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ShareClient
ShareClient 对象指示将下载文件的共享。
类型: | ShareClient |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ShareDirectoryClient
ShareDirectoryClient 对象指示将下载文件的云目录。
类型: | ShareDirectoryClient |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ShareFileClient
ShareFileClient 对象指示要下载的云文件。
类型: | ShareFileClient |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ShareName
指定文件共享的名称。 此 cmdlet 下载共享中文件的内容,此参数指定。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |