Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message enhancement for clear-content cmdlet when targeting a directory #8134

Merged
merged 9 commits into from Nov 1, 2018
Merged

Conversation

kvprasoon
Copy link
Contributor

@kvprasoon kvprasoon commented Oct 27, 2018

PR Summary

Error message enhancement for clear-content cmdlet when targeting a directory

PR Checklist

if (Directory.Exists(path))
{
throw PSTraceSource.NewNotSupportedException(SessionStateStrings.ClearDirectoryContent, path);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect non-terminating error.

/cc @mklement0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should be non-terminating error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the check should be in the FileSystemProvider in this function:

not in the engine.

if (Directory.Exists(path))
{
throw PSTraceSource.NewNotSupportedException(SessionStateStrings.ClearDirectoryContent, path);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should be non-terminating error.

if (Directory.Exists(path))
{
throw PSTraceSource.NewNotSupportedException(SessionStateStrings.ClearDirectoryContent, path);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the check should be in the FileSystemProvider in this function:

not in the engine.

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the contribution!

Copy link
Contributor

@anmenaga anmenaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iSazonov iSazonov self-assigned this Oct 30, 2018
@iSazonov
Copy link
Collaborator

@kvprasoon Please add empty commit with "[Feature]" in header to run full test set.

@iSazonov iSazonov merged commit f59353d into PowerShell:master Nov 1, 2018
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants