Skip to content

Commit cb6f5e7

Browse files
committed
[Storage] update help
1 parent 2841667 commit cb6f5e7

File tree

47 files changed

+823
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+823
-121
lines changed

src/Storage/Storage.Management/help/Az.Storage.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Adds an action to the input ManagementPolicy Action Group object, or creates a M
2020
### [Add-AzStorageAccountNetworkRule](Add-AzStorageAccountNetworkRule.md)
2121
Add IpRules or VirtualNetworkRules to the NetworkRule property of a Storage account
2222

23+
### [Close-AzStorageFileHandle](Close-AzStorageFileHandle.md)
24+
Closes file handles of a file share, a file directory or a file.
25+
2326
### [Disable-AzStorageBlobDeleteRetentionPolicy](Disable-AzStorageBlobDeleteRetentionPolicy.md)
2427
Disable delete retention policy for the Azure Storage Blob service.
2528

@@ -89,6 +92,9 @@ Downloads the contents of a file.
8992
### [Get-AzStorageFileCopyState](Get-AzStorageFileCopyState.md)
9093
Gets the state of a copy operation.
9194

95+
### [Get-AzStorageFileHandle](Get-AzStorageFileHandle.md)
96+
Lists file handles of a file share, a file directory or a file.
97+
9298
### [Get-AzStorageQueue](Get-AzStorageQueue.md)
9399
Lists storage queues.
94100

Lines changed: 374 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,374 @@
1+
---
2+
external help file: Microsoft.Azure.PowerShell.Cmdlets.Storage.dll-Help.xml
3+
Module Name: Az.Storage
4+
online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/close-azstoragefilehandle
5+
schema: 2.0.0
6+
---
7+
8+
# Close-AzStorageFileHandle
9+
10+
## SYNOPSIS
11+
Closes file handles of a file share, a file directory or a file.
12+
13+
## SYNTAX
14+
15+
### ShareNameCloseAll (Default)
16+
```
17+
Close-AzStorageFileHandle [-ShareName] <String> [[-Path] <String>] [-Recursive] [-CloseAll]
18+
[-Context <IStorageContext>] [-PassThru] [-AsJob] [-ServerTimeoutPerRequest <Int32>]
19+
[-ClientTimeoutPerRequest <Int32>] [-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
20+
[-WhatIf] [-Confirm] [<CommonParameters>]
21+
```
22+
23+
### ShareNameCloseSingle
24+
```
25+
Close-AzStorageFileHandle [-ShareName] <String> -FileHandle <PSFileHandle> [-Context <IStorageContext>]
26+
[-PassThru] [-AsJob] [-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
27+
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>] [-WhatIf] [-Confirm]
28+
[<CommonParameters>]
29+
```
30+
31+
### ShareCloseAll
32+
```
33+
Close-AzStorageFileHandle [-Share] <CloudFileShare> [[-Path] <String>] [-Recursive] [-CloseAll] [-PassThru]
34+
[-AsJob] [-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
35+
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>] [-WhatIf] [-Confirm]
36+
[<CommonParameters>]
37+
```
38+
39+
### ShareCloseSingle
40+
```
41+
Close-AzStorageFileHandle [-Share] <CloudFileShare> -FileHandle <PSFileHandle> [-PassThru] [-AsJob]
42+
[-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
43+
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>] [-WhatIf] [-Confirm]
44+
[<CommonParameters>]
45+
```
46+
47+
### DirectoryCloseAll
48+
```
49+
Close-AzStorageFileHandle [-Directory] <CloudFileDirectory> [[-Path] <String>] [-Recursive] [-CloseAll]
50+
[-PassThru] [-AsJob] [-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
51+
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>] [-WhatIf] [-Confirm]
52+
[<CommonParameters>]
53+
```
54+
55+
### FileCloseAll
56+
```
57+
Close-AzStorageFileHandle [-File] <CloudFile> [-CloseAll] [-PassThru] [-AsJob]
58+
[-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
59+
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>] [-WhatIf] [-Confirm]
60+
[<CommonParameters>]
61+
```
62+
63+
## DESCRIPTION
64+
The **Close-AzStorageFileHandle** cmdlet closes file handles of a file share, or file directory or a file.
65+
66+
## EXAMPLES
67+
68+
### Example 1: Lists all file shares of current Storage Account, and close all file handles of the file shares recursively.
69+
```
70+
PS C:\>Get-AzStorageShare | Close-AzStorageFileHandle -CloseAll -Recursive
71+
```
72+
73+
This command lists all file shares of current Storage Account, and close all file handles of the file shares recursively..
74+
75+
### Example 2: Close all file handles on a file directory recursively and show the closed file handle count
76+
```
77+
PS C:\>Close-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -CloseAll -PassThru
78+
10
79+
```
80+
81+
This command closes all file handles on a file directory and show the closed file handle count.
82+
83+
### Example 3: List first 2 file handles of a file directory, and then close them
84+
```
85+
PS C:\>Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -First 2 | Close-AzStorageFileHandle -ShareName "mysharename"
86+
```
87+
88+
This command lists first 2 file handles on a file directory recursively, and then close them
89+
90+
### Example 4: Close all file handles on a file
91+
```
92+
PS C:\>Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -CloseAll
93+
```
94+
95+
This command closes all file handles on a file.
96+
97+
## PARAMETERS
98+
99+
### -AsJob
100+
Run cmdlet in the background
101+
102+
```yaml
103+
Type: System.Management.Automation.SwitchParameter
104+
Parameter Sets: (All)
105+
Aliases:
106+
107+
Required: False
108+
Position: Named
109+
Default value: None
110+
Accept pipeline input: False
111+
Accept wildcard characters: False
112+
```
113+
114+
### -ClientTimeoutPerRequest
115+
The client side maximum execution time for each request in seconds.
116+
117+
```yaml
118+
Type: System.Nullable`1[System.Int32]
119+
Parameter Sets: (All)
120+
Aliases: ClientTimeoutPerRequestInSeconds
121+
122+
Required: False
123+
Position: Named
124+
Default value: None
125+
Accept pipeline input: False
126+
Accept wildcard characters: False
127+
```
128+
129+
### -CloseAll
130+
Force close all File handles.
131+
132+
```yaml
133+
Type: System.Management.Automation.SwitchParameter
134+
Parameter Sets: ShareNameCloseAll, ShareCloseAll, DirectoryCloseAll, FileCloseAll
135+
Aliases:
136+
137+
Required: True
138+
Position: Named
139+
Default value: None
140+
Accept pipeline input: False
141+
Accept wildcard characters: False
142+
```
143+
144+
### -ConcurrentTaskCount
145+
The total amount of concurrent async tasks.
146+
The default value is 10.
147+
148+
```yaml
149+
Type: System.Nullable`1[System.Int32]
150+
Parameter Sets: (All)
151+
Aliases:
152+
153+
Required: False
154+
Position: Named
155+
Default value: None
156+
Accept pipeline input: False
157+
Accept wildcard characters: False
158+
```
159+
160+
### -Context
161+
Azure Storage Context Object
162+
163+
```yaml
164+
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext
165+
Parameter Sets: ShareNameCloseAll, ShareNameCloseSingle
166+
Aliases:
167+
168+
Required: False
169+
Position: Named
170+
Default value: None
171+
Accept pipeline input: True (ByPropertyName, ByValue)
172+
Accept wildcard characters: False
173+
```
174+
175+
### -DefaultProfile
176+
The credentials, account, tenant, and subscription used for communication with Azure.
177+
178+
```yaml
179+
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
180+
Parameter Sets: (All)
181+
Aliases: AzureRmContext, AzureCredential
182+
183+
Required: False
184+
Position: Named
185+
Default value: None
186+
Accept pipeline input: False
187+
Accept wildcard characters: False
188+
```
189+
190+
### -Directory
191+
CloudFileDirectory object indicated the base folder where the files/directories would be listed.
192+
193+
```yaml
194+
Type: Microsoft.Azure.Storage.File.CloudFileDirectory
195+
Parameter Sets: DirectoryCloseAll
196+
Aliases:
197+
198+
Required: True
199+
Position: 0
200+
Default value: None
201+
Accept pipeline input: True (ByValue)
202+
Accept wildcard characters: False
203+
```
204+
205+
### -File
206+
CloudFile object indicated the file to close handle.
207+
208+
```yaml
209+
Type: Microsoft.Azure.Storage.File.CloudFile
210+
Parameter Sets: FileCloseAll
211+
Aliases:
212+
213+
Required: True
214+
Position: 0
215+
Default value: None
216+
Accept pipeline input: True (ByValue)
217+
Accept wildcard characters: False
218+
```
219+
220+
### -FileHandle
221+
The File Handle to close.
222+
223+
```yaml
224+
Type: Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel.PSFileHandle
225+
Parameter Sets: ShareNameCloseSingle, ShareCloseSingle
226+
Aliases:
227+
228+
Required: True
229+
Position: Named
230+
Default value: None
231+
Accept pipeline input: True (ByValue)
232+
Accept wildcard characters: False
233+
```
234+
235+
### -PassThru
236+
Return whether the specified blob is successfully removed
237+
238+
```yaml
239+
Type: System.Management.Automation.SwitchParameter
240+
Parameter Sets: (All)
241+
Aliases:
242+
243+
Required: False
244+
Position: Named
245+
Default value: None
246+
Accept pipeline input: False
247+
Accept wildcard characters: False
248+
```
249+
250+
### -Path
251+
Path to an existing file/directory.
252+
253+
```yaml
254+
Type: System.String
255+
Parameter Sets: ShareNameCloseAll, ShareCloseAll, DirectoryCloseAll
256+
Aliases:
257+
258+
Required: False
259+
Position: 1
260+
Default value: None
261+
Accept pipeline input: False
262+
Accept wildcard characters: False
263+
```
264+
265+
### -Recursive
266+
List handles Recursively.
267+
Only works on File Directory.
268+
269+
```yaml
270+
Type: System.Management.Automation.SwitchParameter
271+
Parameter Sets: ShareNameCloseAll, ShareCloseAll, DirectoryCloseAll
272+
Aliases:
273+
274+
Required: False
275+
Position: Named
276+
Default value: None
277+
Accept pipeline input: False
278+
Accept wildcard characters: False
279+
```
280+
281+
### -ServerTimeoutPerRequest
282+
The server time out for each request in seconds.
283+
284+
```yaml
285+
Type: System.Nullable`1[System.Int32]
286+
Parameter Sets: (All)
287+
Aliases: ServerTimeoutPerRequestInSeconds
288+
289+
Required: False
290+
Position: Named
291+
Default value: None
292+
Accept pipeline input: False
293+
Accept wildcard characters: False
294+
```
295+
296+
### -Share
297+
CloudFileShare object indicated the share where the files/directories would be listed.
298+
299+
```yaml
300+
Type: Microsoft.Azure.Storage.File.CloudFileShare
301+
Parameter Sets: ShareCloseAll, ShareCloseSingle
302+
Aliases:
303+
304+
Required: True
305+
Position: 0
306+
Default value: None
307+
Accept pipeline input: True (ByValue)
308+
Accept wildcard characters: False
309+
```
310+
311+
### -ShareName
312+
Name of the file share where the files/directories would be listed.
313+
314+
```yaml
315+
Type: System.String
316+
Parameter Sets: ShareNameCloseAll, ShareNameCloseSingle
317+
Aliases:
318+
319+
Required: True
320+
Position: 0
321+
Default value: None
322+
Accept pipeline input: False
323+
Accept wildcard characters: False
324+
```
325+
326+
### -Confirm
327+
Prompts you for confirmation before running the cmdlet.
328+
329+
```yaml
330+
Type: System.Management.Automation.SwitchParameter
331+
Parameter Sets: (All)
332+
Aliases: cf
333+
334+
Required: False
335+
Position: Named
336+
Default value: None
337+
Accept pipeline input: False
338+
Accept wildcard characters: False
339+
```
340+
341+
### -WhatIf
342+
Shows what would happen if the cmdlet runs.
343+
The cmdlet is not run.
344+
345+
```yaml
346+
Type: System.Management.Automation.SwitchParameter
347+
Parameter Sets: (All)
348+
Aliases: wi
349+
350+
Required: False
351+
Position: Named
352+
Default value: None
353+
Accept pipeline input: False
354+
Accept wildcard characters: False
355+
```
356+
357+
### CommonParameters
358+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
359+
360+
## INPUTS
361+
362+
### Microsoft.Azure.Storage.File.CloudFileShare
363+
364+
### Microsoft.Azure.Storage.File.CloudFileDirectory
365+
366+
### Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext
367+
368+
## OUTPUTS
369+
370+
### Microsoft.Azure.Storage.File.CloseFileHandleResultSegment
371+
372+
## NOTES
373+
374+
## RELATED LINKS

0 commit comments

Comments
 (0)