Skip to content

Commit fbb742c

Browse files
authored
Merge pull request #113574 from normesta/normesta-sdk-interop
Fixing a bug raised by a github issue
2 parents 4f97b62 + 349f421 commit fbb742c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

articles/storage/blobs/data-lake-storage-directory-file-acl-powershell.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,25 @@ In this example, the owning user and owning group have only read and write permi
346346

347347
### Set ACLs on all items in a file system
348348

349-
You can use the `Get-AzDataLakeGen2Item` and the `-Recurse` parameter together with the `Update-AzDataLakeGen2Item` cmdlet to recursively to set the ACL of all directories and files in a file system.
349+
You can use the `Get-AzDataLakeGen2Item` and the `-Recurse` parameter together with the `Update-AzDataLakeGen2Item` cmdlet to recursively to set the ACL for directories and files in a file system.
350350

351351
```powershell
352352
$filesystemName = "my-file-system"
353353
$acl = set-AzDataLakeGen2ItemAclObject -AccessControlType user -Permission rw-
354354
$acl = set-AzDataLakeGen2ItemAclObject -AccessControlType group -Permission rw- -InputObject $acl
355355
$acl = set-AzDataLakeGen2ItemAclObject -AccessControlType other -Permission -wx -InputObject $acl
356-
Get-AzDataLakeGen2ChildItem -Context $ctx -FileSystem $filesystemName -Recurse | Update-AzDataLakeGen2Item -Acl $acl
356+
357+
$Token = $Null
358+
do
359+
{
360+
$items = Get-AzDataLakeGen2ChildItem -Context $ctx -FileSystem $filesystemName -Recurse -ContinuationToken $Token
361+
if($items.Length -le 0) { Break;}
362+
$items | Update-AzDataLakeGen2Item -Acl $acl
363+
$Token = $items[$items.Count -1].ContinuationToken;
364+
}
365+
While ($Token -ne $Null)
357366
```
367+
358368
### Add or update an ACL entry
359369

360370
First, get the ACL. Then, use the `set-AzDataLakeGen2ItemAclObject` cmdlet to add or update an ACL entry. Use the `Update-AzDataLakeGen2Item` cmdlet to commit the ACL.

0 commit comments

Comments
 (0)