Powershell. Deleting files without a recycle bin

409 Views Asked by At

How to implement file deletion in Powershell without putting it in recycle.bin? The current command moves files older than 30 days to the trash.

$int1 = 30
New-PSDrive -Name "E" -PSProvider "FileSystem" -Root "\\Computer\c`$\Folder" -Persist
#FORFILES /p E:\ /s /m *.* /d -$int1 /c "CMD /c del /Q @FILE"
1

There are 1 best solutions below

0
Avshalom On

Remove-Item Deleting files without moving them to the Recycle Bin