Mohamed BOUAKKAZ
Mohamed BOUAKKAZ

Reputation: 45

Powershell Compress-Archive comand delete after compresssion

I'm using the Compress-Archive command to zip the content of a folder and I need to delete the compressed files on the original folder afterwards. Is there an option on the command to do so ?

Upvotes: 0

Views: 5901

Answers (1)

Isaac
Isaac

Reputation: 804

What boxdog said. Compressing the archive using Compress-Archive makes a different file name i.e compressedfoo.dir -> compressedfoo.zip. So You can just delete the original file using Remove-Item cmdlet and specifying the original filepath

Upvotes: 1

Related Questions