你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzStorageFileHandle
列出文件共享、文件目录或文件的文件句柄。
语法
Get-AzStorageFileHandle
[-ShareName] <String>
[[-Path] <String>]
[-Recursive]
[-DisAllowTrailingDot]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-IncludeTotalCount]
[-Skip <UInt64>]
[-First <UInt64>]
[<CommonParameters>]
Get-AzStorageFileHandle
[-ShareClient] <ShareClient>
[[-Path] <String>]
[-Recursive]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-IncludeTotalCount]
[-Skip <UInt64>]
[-First <UInt64>]
[<CommonParameters>]
Get-AzStorageFileHandle
[-ShareDirectoryClient] <ShareDirectoryClient>
[[-Path] <String>]
[-Recursive]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-IncludeTotalCount]
[-Skip <UInt64>]
[-First <UInt64>]
[<CommonParameters>]
Get-AzStorageFileHandle
[-ShareFileClient <ShareFileClient>]
[-Recursive]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-IncludeTotalCount]
[-Skip <UInt64>]
[-First <UInt64>]
[<CommonParameters>]
说明
Get-AzStorageFileHandle cmdlet 列出了文件共享、文件目录或文件的文件句柄。
示例
示例 1:以递归方式列出文件共享上的所有文件句柄,并按 ClientIp 和 OpenTime 排序
Get-AzStorageFileHandle -ShareName "mysharename" -Recursive | Sort-Object ClientIP,OpenTime
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId ClientName
-------- ---- -------- ---------- -------- ----------------- ------ -------- --------- ----------
28506980357 104.46.105.229 49805 2019-07-29 08:37:36Z 0 0 9297571480349046273 myclientvm
28506980537 dir1 104.46.105.229 49805 2019-07-30 09:28:48Z 10376363910205800448 0 9297571480349046273 myclientvm
28506980538 dir1 104.46.105.229 49805 2019-07-30 09:28:48Z 10376363910205800448 0 9297571480349046273 myclientvm
28582543365 104.46.119.170 51675 2019-07-30 09:29:32Z 0 0 9477733061320772929 myclientvm
28582543375 dir1 104.46.119.170 51675 2019-07-30 09:29:38Z 10376363910205800448 0 9477733061320772929 myclientvm
28582543376 dir1 104.46.119.170 51675 2019-07-30 09:29:38Z 10376363910205800448 0 9477733061320772929 myclientvm
此命令列出文件共享上的文件句柄,并按 ClientIp、OpenTime 对输出进行排序。
示例 2:以递归方式列出文件目录上的前 2 个文件句柄
Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -First 2
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId ClientName
-------- ---- -------- ---------- -------- ----------------- ------ -------- --------- ----------
24057151779 dir1/dir2 104.46.105.229 50861 2019-06-18 07:39:23Z 16140971433240035328 11529285414812647424 9549812641162070049 myclientvm
24057151780 dir1/dir2 104.46.105.229 50861 2019-06-18 07:39:23Z 16140971433240035328 11529285414812647424 9549812641162070049 myclientvm
此命令以递归方式列出文件目录上的前 2 个文件句柄。
示例 3:列出文件的第 3 个到第 6 个文件句柄
Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -skip 2 -First 4
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId ClientName
-------- ---- -------- ---------- -------- ----------------- ------ -------- --------- ----------
24055513248 dir1/dir2/test.txt 104.46.105.229 49817 2019-06-18 08:21:59Z 9223407221226864640 16140971433240035328 9338416139169958321 myclientvm
24055513249 dir1/dir2/test.txt 104.46.105.229 49817 2019-06-18 08:21:59Z 9223407221226864640 16140971433240035328 9338416139169958321 myclientvm
24055513252 dir1/dir2/test.txt 104.46.105.229 49964 2019-06-18 08:22:54Z 9223407221226864640 16140971433240035328 9338416138431762125 myclientvm
24055513253 dir1/dir2/test.txt 104.46.105.229 49964 2019-06-18 08:22:54Z 9223407221226864640 16140971433240035328 9338416138431762125 myclientvm
此命令列出文件的第 3 个到第 6 个文件句柄。
参数
-ClientTimeoutPerRequest
客户端每个请求的最大执行时间(以秒为单位)。
类型: | Nullable<T>[Int32] |
别名: | ClientTimeoutPerRequestInSeconds |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ConcurrentTaskCount
并发异步任务的总数。 默认值为 10。
类型: | Nullable<T>[Int32] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Context
Azure 存储上下文对象
类型: | IStorageContext |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DisAllowTrailingDot
禁止尾随点 (.) 后缀目录和文件名。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-First
仅获取第一个“n”对象。
类型: | UInt64 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IncludeTotalCount
报告数据集(整数)中的对象数,后跟对象。 如果 cmdlet 无法确定总计数,则返回“未知总计计数”。 目前,此参数不执行任何操作。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Path
现有文件/目录的路径。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Recursive
列表以递归方式处理。 仅适用于文件目录。
类型: | 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: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ShareName
将列出文件/目录的文件共享的名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Skip
忽略第一个“n”对象,然后获取剩余的对象。
类型: | UInt64 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |