/// <summary> /// Set ACL recusive async function /// </summary> protected override async Task OperationAclResusive(long taskId) { IStorageBlobManagement localChannel = Channel; progressRecord = GetProgressRecord("Set", taskId); continuationToken = this.ContinuationToken; bool foundAFolder = false; DataLakeFileClient fileClient = null; DataLakeDirectoryClient dirClient = null; DataLakeFileSystemClient fileSystem = GetFileSystemClientByName(localChannel, this.FileSystem); foundAFolder = GetExistDataLakeGen2Item(fileSystem, this.Path, out fileClient, out dirClient); if (foundAFolder) { if (ShouldProcess(dirClient.Uri.ToString(), "Set Acl recursively on Directory: ")) { await dirClient.SetAccessControlRecursiveAsync(PSPathAccessControlEntry.ParseAccessControls(this.Acl), continuationToken, GetAccessControlChangeOptions(taskId), CmdletCancellationToken).ConfigureAwait(false); SetProgressComplete(); WriteResult(taskId); } } else { if (ShouldProcess(fileClient.Uri.ToString(), "Set Acl recursively on File: ")) { await fileClient.SetAccessControlRecursiveAsync(PSPathAccessControlEntry.ParseAccessControls(this.Acl), continuationToken, GetAccessControlChangeOptions(taskId), CmdletCancellationToken).ConfigureAwait(false); SetProgressComplete(); WriteResult(taskId); } } }