/// <summary> /// Remove ACL recusive async function /// </summary> protected override async Task OperationAclResusive(long taskId) { IStorageBlobManagement localChannel = Channel; progressRecord = GetProgressRecord("Remove", 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(), "Remove Acl recursively on Directory: ")) { WriteWarning("To find the ACL Entry to remove, will only compare AccessControlType, DefaultScope and EntityId, will omit Permission."); await dirClient.RemoveAccessControlRecursiveAsync(PSPathAccessControlEntry.ParseRemoveAccessControls(this.Acl), continuationToken, GetAccessControlChangeOptions(taskId), CmdletCancellationToken).ConfigureAwait(false); SetProgressComplete(); WriteResult(taskId); } } else { if (ShouldProcess(fileClient.Uri.ToString(), "Remove Acl recursively on File: ")) { WriteWarning("To find the ACL Entry to remove, will only compare AccessControlType, DefaultScope and EntityId, will omit Permission."); await fileClient.RemoveAccessControlRecursiveAsync(PSPathAccessControlEntry.ParseRemoveAccessControls(this.Acl), continuationToken, GetAccessControlChangeOptions(taskId), CmdletCancellationToken).ConfigureAwait(false); SetProgressComplete(); WriteResult(taskId); } } }