OS: | Windows | ||||||||
Type: | A Windows PowerShell script | ||||||||
Language: | Windows PowerShell | ||||||||
Description: | Remove-EmptyFolders searches for empty folders from a directory specified with the -Path parameter. By default the search is limited to the first directory level (i.e. the search and removal of the empty folders is done non-recursively), but if a -Recurse parameter is added to the launching command, Remove-EmptyFolders will remove empty folders from the subdirectories as well (i.e. the search and removal is done recursively).
If deletions are made, a log-file ( deleted_folders.txt by default) is created to $env:temp , which points to the current temporary file location and is set in the system (β for more information about $env:temp , please see the Notes section). The filename of the log-file can be set with the -FileName parameter (a filename with a .txt ending is recommended) and the default output destination folder may be changed with the -Output parameter. During the possibly invoked log-file creation procedure Remove-EmptyFolders tries to preserve any pre-existing content rather than overwrite the specified file, so if the -FileName parameter points to an existing file, new log-info data is appended to the end of that file.
To invoke a simulation run, where no folders would be deleted in any circumstances, a parameter -WhatIf may be added to the launching command. If the -Audio parameter has been used, an audible beep would be emitted after Remove-EmptyFolders has deleted one or more folders. Please note that if any of the parameter values (after the parameter name itself) includes space characters, the value should be enclosed in quotation marks (single or double) so that PowerShell can interpret the command correctly. |
||||||||
Homepage: | https://github.com/auberginehill/remove-empty-folders
Short URL: http://tinyurl.com/zbug5ep |
||||||||
Version: | 1.1 | ||||||||
Sources: |
|
||||||||
Downloads: | For instance Remove-EmptyFolders.ps1. Or everything as a .zip-file. |
π |
|
---|---|
|
β‘οΈ |
|
||||||
---|---|---|---|---|---|---|---|
|
|
|
|
π | To open this code in Windows PowerShell, for instance: | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Find a bug? Have a feature request? Here is how you can contribute to this project:
Bugs: | Submit bugs and help us verify fixes. | |
Feature Requests: | Feature request can be submitted by creating an Issue. | |
Edit Source Files: | Submit pull requests for bug fixes and features and discuss existing proposals. |