Tuesday, May 24, 2016

PowerShell cmdlet of the Day : Clear-RecycleBin

Do you love sweets? I love them.  And there are some Powershell cmdlets those are tooo sweet like a sweet.

If you want to clear/ empty your recycle bin, there is a very sweet Powershell cmdlet available for it, which is Clear-RecycleBin .

Just run the cmdlet, and it will empty your recycle bin.  You can incorporate this cmdlet to your TEMP file cleaning scripts too.Clear-RecycleBin

If you just run the Clear-RecycleBin, it will ask you for Yes/No confirmation, you can -                        -Confirm:$false to omit it.

Clear-RecycleBin -Confirm:$false
Aman Dhally , Manya Kaur
So sweet isn't? :)
I have tested the above cmdlet on Windows 10 machine :)
Thanks
Aman Dhally , Manya Kaur

With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel
for PowerShell video tutorials. You can download all of my scripts from “Microsoft
TechNet Gallery”.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.