2017 answer: use the Recycle module
Install-Module -Name Recycle
Then run:
Remove-ItemSafely file
I like to make an alias called trash
for this.
More Related Contents:
- Powershell function call changing passed string into int
- Different behaviour and output when piping in CMD and PowerShell
- PowerShell’s parsing modes: argument (command) mode vs. expression mode
- How do I capture the output into a variable from an external process in PowerShell?
- How to get an object’s property’s value by property name?
- Delete files older than 15 days using PowerShell
- Output (“echo”) a variable to a text file
- Powershell equivalent of bash ampersand (&) for forking/running background processes
- INI file parsing in PowerShell
- Parameter interpretation when running jobs
- Powershell: Uninstall application by UpgradeCode
- Export-CSV exports length but not name
- How to properly -filter multiple strings in a PowerShell copy script
- Methods to hex edit binary files via Powershell
- How remove accents in PowerShell?
- Unable to convert a string to an integer variable from DateTaken attribute on a JPG file
- How to Grant permission to user on Certificate private key using powershell?
- Using Invoke-Command -ScriptBlock on a function with arguments
- How to use PowerShell copy-item and keep structure
- Powershell – Reboot and Continue Script
- How can I execute an external program with parameters in PowerShell?
- Rename file on FTP with PowerShell
- Does PowerShell support HashTable Serialization?
- PowerShell The term is not recognized as cmdlet function script file or operable program
- Powershell: resolve path that might not exist?
- Using PowerShell to remove lines from a text file if it contains a string
- How to execute a PowerShell script only before a web deploy Publish task in VS 2012?
- Jenkins powershell plugin is running 32 bit Powershell and I need 64bit
- Powershell – Output Color for certain results
- Pass function as a parameter