Close-AzStorageFileHandle
语法
ShareNameCloseAll (默认值)
Close-AzStorageFileHandle
[-ShareName] <String>
[[-Path] <String>]
[-Recursive]
[-CloseAll]
[-DisAllowTrailingDot]
[-PassThru]
[-AsJob]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ShareNameCloseSingle
Close-AzStorageFileHandle
[-ShareName] <String>
-FileHandle <PSFileHandle>
[-DisAllowTrailingDot]
[-PassThru]
[-AsJob]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ShareCloseAll
Close-AzStorageFileHandle
[-ShareClient] <ShareClient>
[[-Path] <String>]
[-Recursive]
[-CloseAll]
[-PassThru]
[-AsJob]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ShareCloseSingle
Close-AzStorageFileHandle
[-ShareClient] <ShareClient>
-FileHandle <PSFileHandle>
[-PassThru]
[-AsJob]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
DirectoryCloseAll
Close-AzStorageFileHandle
[-ShareDirectoryClient] <ShareDirectoryClient>
[[-Path] <String>]
[-Recursive]
[-CloseAll]
[-PassThru]
[-AsJob]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
FileCloseAll
Close-AzStorageFileHandle
[-ShareFileClient] <ShareFileClient>
[-CloseAll]
[-PassThru]
[-AsJob]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Close-AzStorageFileHandle cmdlet 关闭文件共享或文件目录或文件的文件句柄。
示例
示例 1:关闭文件上的所有文件句柄
Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -CloseAll
此命令关闭文件上的所有文件句柄。
示例 2:关闭文件目录中 1 天前打开的所有文件句柄
Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive | Where-Object {$_.OpenTime.DateTime.AddDays(1) -lt (Get-Date)} | Close-AzStorageFileHandle -ShareName "mysharename"
此命令以递归方式列出文件目录上的所有文件句柄,筛选掉 1 天前打开的句柄,然后关闭它们。
示例 3:以递归方式关闭文件目录上的所有文件句柄,并显示关闭的文件句柄计数
Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -CloseAll -PassThru
10
此命令关闭文件目录上的所有文件句柄,并显示关闭的文件句柄计数。
示例 4:关闭文件共享上的所有文件句柄
Close-AzStorageFileHandle -ShareName "mysharename" -CloseAll -Recursive
此命令以递归方式关闭特定文件共享上的所有文件句柄。
参数
-AsJob
在后台运行 cmdlet
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ClientTimeoutPerRequest
客户端每个请求的最大执行时间(以秒为单位)。
参数属性
| 类型: | Nullable<T>[Int32]
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | ClientTimeoutPerRequestInSeconds |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-CloseAll
强制关闭所有文件句柄。
参数属性
参数集
ShareNameCloseAll
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
ShareCloseAll
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
DirectoryCloseAll
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
FileCloseAll
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ConcurrentTaskCount
并发异步任务的总数。
默认值为 10。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Context
Azure 存储上下文对象
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DisAllowTrailingDot
禁止尾随点 (.) 后缀目录和文件名。
参数属性
参数集
ShareNameCloseAll
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
ShareNameCloseSingle
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-FileHandle
要关闭的文件句柄。
参数属性
参数集
ShareNameCloseSingle
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
ShareCloseSingle
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-PassThru
返回已关闭的文件句柄计数。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Path
现有文件/目录的路径。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
ShareNameCloseAll
| Position: | 1 |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
ShareCloseAll
| Position: | 1 |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
DirectoryCloseAll
| Position: | 1 |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Recursive
列表以递归方式处理。
仅适用于文件目录。
参数属性
参数集
ShareNameCloseAll
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
ShareCloseAll
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
DirectoryCloseAll
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ServerTimeoutPerRequest
服务器为每个请求超时(以秒为单位)。
参数属性
| 类型: | Nullable<T>[Int32]
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | ServerTimeoutPerRequestInSeconds |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ShareClient
ShareClient 对象指示包含要关闭句柄的文件/目录的共享。
参数属性
参数集
ShareCloseAll
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
ShareCloseSingle
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ShareDirectoryClient
ShareDirectoryClient 对象指示包含要关闭句柄的文件/目录的基文件夹。
参数属性
参数集
DirectoryCloseAll
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ShareFileClient
ShareFileClient 对象指示要关闭句柄的文件。
参数属性
参数集
FileCloseAll
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ShareName
将列出文件/目录的文件共享的名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
ShareNameCloseAll
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
ShareNameCloseSingle
| 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。
输出