https://github.com/carlosulisesochoa/subdirectory-file-extractor-powershell
PowerShell script that moves all the files from subdirectories to the root directory
https://github.com/carlosulisesochoa/subdirectory-file-extractor-powershell
powershell script scripting subdirectory-file-extractor windows
Last synced: 2 months ago
JSON representation
PowerShell script that moves all the files from subdirectories to the root directory
- Host: GitHub
- URL: https://github.com/carlosulisesochoa/subdirectory-file-extractor-powershell
- Owner: CarlosUlisesOchoa
- License: mit
- Created: 2023-04-27T00:13:40.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-01T22:58:18.000Z (about 3 years ago)
- Last Synced: 2025-05-23T19:37:37.806Z (about 1 year ago)
- Topics: powershell, script, scripting, subdirectory-file-extractor, windows
- Language: PowerShell
- Homepage:
- Size: 193 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Subdirectory File Extractor
Subdirectory File Extractor is a PowerShell script that moves all the files from subdirectories to the root directory, while preventing duplicates by renaming them with the parent directory name.
## Table of Contents
- [System Requirements](#system-requirements)
- [Usage](#usage)
- [Result](#result)
- [License](#license)
- [About developer](#about-developer)
## System Requirements
- Windows OS (tested on Windows 10 and 11)
- PowerShell 5.1 or later
## Usage
1. [Download](https://raw.githubusercontent.com/CarlosUlisesOchoa/Subdirectory-file-extractor-PowerShell-/main/files-extractor.ps1) the `files-extractor.ps1` script.
2. Save the script to a directory on your computer.
3. Open PowerShell and navigate to the directory where the script is saved.
4. Run the script with the `-d` parameter and specify the directory
Example:
PowerShell:
```PowerShell
.\files-extractor.ps1 -d "C:\Shane\my-root-dir"
```
## Result
**Before:**

**After:**

## License
This project is released under the [MIT License](LICENSE).
## About developer
Visit my web [Carlos Ochoa](https://carlos8a.com)
---
**Note:** If you encounter any issues with the script, please report them [here](https://github.com/CarlosUlisesOchoa/Subdirectory-file-extractor-PowerShell/issues). Contributions are welcome!