Azure / Azure/azure-powershell

[Feature]: Remove-AzDataLakeGen2Item switch to stop it erroring when File/Directory does not exist.

Open
#22,701 3 comments 0 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad customer-reported Data Lake Storage Gen2 feature-request Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description of the new feature

Both Get-AzDataLakeGen2Item and Remove-AzDataLakeGen2Item write out an error if the file/directory don't exist and there is no Test-AzDataLakeGen2Item cmdlet. This makes it tricky to deal with the situation where you have a list of directories/files to remove some of which may not exist. I can add -ErrorAction Continue, SilentlyContinue or Ignore but this also ignores other errors such as connection issues. It would be nice to be able to ignore this error without ignoring other errors. Also this feels like it should be more of a warning than an error anyway as the end result is that the thing that is being deleted does not exist which is probably fine in most cases.

### Proposed implementation details (optional)

Add a succeed if missing switch:

Remove-AzDataLakeGen2Item -SucceedIfMissing

Contributor guide

Open the contributing guide

Research direction

The payload names the Remove-AzDataLakeGen2Item cmdlet and the related Get-AzDataLakeGen2Item behavior, but no files or tests. Start by locating the Remove-AzDataLakeGen2Item implementation and its not-found error path; done means -SucceedIfMissing handles absent files or directories without suppressing unrelated errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.