Delete empty files and folders using PowerShell Script

Published: 12 November 2021
on channel: Invisible Pandu
172
14

#bestinformation #viralvideo #computerinformation #information #knowledge #computer_knowledge #best_information #good_information #powershellscripting

👉Get list of Empty folder using Powershell Script:    • How to get the list of empty folders ...  

👉Note: This Script will delete Empty Files and Folders!
👉Copy Script:
gci "C:\Users\pc\Desktop\Demo" -Recurse | foreach {
if($_.Length -eq 0) {
Write-Output "Removing Empty Files $($_.FullName)"
$_.FullName | Remove-Item -Force }
if($_.psiscontainer -eq $true) {
if((gci $_.FullName) -eq $null){
Write-Output "Removing Empty Folder $($_.FullName)"
$_.FullName | Remove-Item -Force } }}


Watch video Delete empty files and folders using PowerShell Script online without registration, duration hours minute second in high quality. This video was added by user Invisible Pandu 12 November 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 172 once and liked it 14 people.