Skip to content

Add back Clear-RecycleBin for Windows - #10909

Merged
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:clear-recyclebin
Oct 28, 2019
Merged

Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:clear-recyclebin

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Oct 27, 2019 •

Copy link
Copy Markdown
Member

PR Summary

Add back Clear-RecycleBin cmdlet for Windows for parity with Windows PowerShell. Addressed misuse of GetLastError() by removing error handling since the API returns error only if recycle bin is empty already which is not useful for this cmdlet.

PR Context

FIx #6743

PR Checklist

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see we can not create tests but maybe it makes sense to add pending dump test to clearly show that we know about it?

@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Oct 27, 2019 •

Copy link
Copy Markdown
Member Author

It's part of the default cmdlets tests verifying it exists on Windows, but not Linux/macOS. Eventually, we want to investigate all pending tests and not have them pending.

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 28, 2019
@iSazonov Ilya (iSazonov) added this to the 7.0.0-preview.6 milestone Oct 28, 2019
@iSazonov
Ilya (iSazonov) merged commit ca1b6fb into PowerShell:master Oct 28, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the clear-recyclebin branch October 28, 2019 03:28
Sean Wheeler (sdwheeler) added a commit to sdwheeler/PowerShell that referenced this pull request Oct 28, 2019
Sean Wheeler (sdwheeler) added a commit to sdwheeler/PowerShell that referenced this pull request Oct 28, 2019
@TravisEz13

Copy link
Copy Markdown
Member

I looked at emptying the macOS trash

dir ~/.Trash/ -Recurse -Directory  -Filter *.app | Remove-Item -Force -Recurse
dir ~/.Trash/* -Recurse -File | remove-item -Force

Some items the normal user doesn't have permissions to.

@ghost

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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.

Misuse of SHEmptyRecycleBin in Clear-RecycleBin cmdlet

3 participants