Delete File or Clear Recycle Bin

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Ben Crane Ben Crane 8 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33872
    Profile photo of Ben Crane
    Ben Crane
    Participant

    Hey all,

    I'm running PowerShell 3.0 : I'm removing files and they're heading into the Recycle Bin – I'd prefer to Remove the files permanently and not have them moved to the RB. If that cannot be done in PS3.0 is there a way of deleting a specific file from the recycle bin? I have the file name in a string so I'm hoping it's just a case of passing it to a function.

    All I've got so far is: Remove-Item $filePath

    Works well, but the files are often very large and storing them in the RB isn't helping the free space on the drive.

    Regards,

    Ben

    #33882
    Profile photo of Peter Jurgens
    Peter Jurgens
    Participant

    That's odd... Sorry, but are you 100% certain it's moving items to the recycle bin? Remove-Item permanently deletes items in my own experience.

    #33934
    Profile photo of Ben Crane
    Ben Crane
    Participant

    Hi Peter,

    Ah yes, you're right – I had some older files with a similar name in the RB and I kept confusing them with the latest files and thinking it wasn't deleting them! Rookie error again

    Many thanks
    Ben

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.