Welcome to the PowerShell-Practical-Guide, a curated collection of practical, real‑world scripts designed to automate common system‑administration, file‑management, and workflow tasks.
Each section in the /docs directory focuses on a specific problem area and includes:
- A clear description of the task
- Usage instructions
- Sanitized, ready‑to‑run PowerShell scripts
- Notes, tips, and optional enhancements
This guide is intended for beginners and intermediate PowerShell users who want to build a reliable toolbox of automation utilities.
The /docs folder contains the following script categories:
- Cleanup Empty Dirs — Identify and remove empty directories safely.
- Cleanup-Installer Orphans — Locate leftover installer files and temporary artifacts.
- Delete duplicate files — Scan for and remove duplicate files using hashing.
- Domain Join Automation — Automate joining Windows machines to a domain.
- Filename List — Generate plain-text filename lists from any folder.
- Find long names — Detect files or folders exceeding Windows path-length limits.
- Linux Stuff — Cross‑platform scripts and notes for PowerShell on Linux.
- Move from folders — Flatten directory structures by moving files upward.
- Windows Batch Scripts (Pre-PowerShell Era) — Legacy
.batscripts preserved for reference. - remove old files — Automatically delete files older than a specified age.
Each section includes Markdown documentation and one or more scripts.
- Browse to the section that matches the task you want to automate.
- Review the description and usage notes.
- Copy the script into your environment or run it directly in PowerShell 5.1 or PowerShell 7+.
- Modify paths and variables as needed for your system.
- Explore related sections to build more advanced workflows.
If you're new to PowerShell, start with:
- Basic file operations
- Understanding the pipeline
- Working with objects
This guide is designed to grow over time. Future additions may include:
- More automation modules
- Cross‑platform examples
- Advanced error handling patterns
- Logging and reporting templates
If you want to add a new section, simply create a folder under /docs and include a Markdown file with:
- Overview
- Usage
- Script
- Notes
This guide is provided as-is for personal and educational use.
Feel free to adapt the scripts to your own environment.