Get-AzStorageFileContent
语法
ShareName (默认值)
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>]
Share
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>]
Directory
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>]
File
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。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-CheckMd5
指定是否检查已下载文件的 Md5 总和。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-ClientTimeoutPerRequest
指定一个服务请求的客户端超时间隔(以秒为单位)。 如果上一次调用在指定的时间间隔内失败,则此 cmdlet 将重试请求。 如果此 cmdlet 在间隔过前未收到成功的响应,则此 cmdlet 将返回错误。
参数属性
类型: | Nullable<T>[Int32]
|
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | ClientTimeoutPerRequestInSeconds |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-ConcurrentTaskCount
指定最大并发网络调用数。 可以使用此参数通过指定并发网络调用的最大数目来限制本地 CPU 和带宽使用量的并发性。 指定的值是绝对计数,不乘以核心计数。 此参数可帮助减少低带宽环境中的网络连接问题,例如每秒 100 千比特。 默认值为 10。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-Context
指定 Azure 存储上下文。 若要获取上下文,请使用 New-AzStorageContext cmdlet。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | True |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-Destination
指定目标路径。
此 cmdlet 会将文件内容下载到此参数指定的位置。
如果指定不存在的文件的路径,此 cmdlet 将创建该文件,并将内容保存在新文件中。
如果指定已存在的文件的路径,并且指定了 Force 参数,则 cmdlet 将覆盖该文件。
如果指定现有文件的路径,并且未指定 Force,则 cmdlet 会在继续之前提示你。
如果指定文件夹的路径,此 cmdlet 将尝试创建一个名称为 Azure 存储文件的文件。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | 2 |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-DisAllowTrailingDot
禁止尾随点 (.) 后缀目录和文件名。
参数属性
参数集
ShareName
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-Force
如果指定不存在的文件的路径,此 cmdlet 将创建该文件,并将内容保存在新文件中。
如果指定已存在的文件的路径,并且指定了 Force 参数,则 cmdlet 将覆盖该文件。
如果指定现有文件的路径,并且未指定 Force,则 cmdlet 会在继续之前提示你。
如果指定文件夹的路径,此 cmdlet 将尝试创建一个名称为 Azure 存储文件的文件。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-PassThru
指示此 cmdlet 返回其下载 AzureStorageFile 对象。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-Path
指定文件路径。
此 cmdlet 获取此参数指定的文件的内容。
如果文件不存在,则此 cmdlet 将返回错误。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
ShareName
Position: | 1 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
Share
Position: | 1 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
Directory
Position: | 1 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-PreserveSMBAttribute
将源文件 SMB 属性(文件属性、文件创建时间、文件上次写入时间)保留在目标文件中。 此参数仅在 Windows 上可用。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-ServerTimeoutPerRequest
指定请求的服务端超时间隔(以秒为单位)。 如果服务处理请求之前指定的间隔已过,则存储服务将返回错误。
参数属性
类型: | Nullable<T>[Int32]
|
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | ServerTimeoutPerRequestInSeconds |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-ShareClient
ShareClient 对象指示将下载文件的共享。
参数属性
参数集
Share
Position: | 0 |
必需: | True |
来自管道的值: | True |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-ShareDirectoryClient
ShareDirectoryClient 对象指示将下载文件的云目录。
参数属性
参数集
Directory
Position: | 0 |
必需: | True |
来自管道的值: | True |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-ShareFileClient
ShareFileClient 对象指示要下载的云文件。
参数属性
参数集
File
Position: | 0 |
必需: | True |
来自管道的值: | True |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-ShareName
指定文件共享的名称。
此 cmdlet 下载共享中文件的内容,此参数指定。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
ShareName
Position: | 0 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。
命令脚本未运行。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输出