PowerShell script to generate realistic dummy file trees with random files for testing and automation.
- PowerShell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitattributes | ||
| DummyFileTreeGenerator.ps1 | ||
| fileNames.csv | ||
| files.csv | ||
| folders.csv | ||
| LICENSE | ||
| README.md | ||
DummyFileTreeGenerator
PowerShell script to generate realistic dummy file trees with random files for testing and automation.
Features
- 📁 Creates realistic folder structures based on CSV templates
- 📄 Downloads and distributes real files across the tree
- 🎲 Randomizes file names by category (documents, images, videos, etc.)
- ⏰ Randomizes file timestamps (CreationTime, LastWriteTime, LastAccessTime)
- 📦 Caches downloaded files to avoid repeated downloads
- ➕ Supports appending to existing folder structures
Use Cases
- Testing backup and sync solutions
- Testing file system utilities
- Creating demo/sample data
- Performance testing with realistic file structures
Quick Start
# Basic usage - creates 100 files in ./DummyFiles
.\DummyFileTreeGenerator.ps1
# Custom target path with 500 files
.\DummyFileTreeGenerator.ps1 -MaxNumberOfFiles 500 -TargetPath "C:\TestData"
# Only include files larger than 5MB
.\DummyFileTreeGenerator.ps1 -MinFileSizeMB 5 -MaxNumberOfFiles 50
# Append to existing folder structure
.\DummyFileTreeGenerator.ps1 -AppendToExisting -TargetPath "C:\ExistingData"
Parameters
| Parameter | Default | Description |
|---|---|---|
-MinFileSizeMB |
0 | Minimum file size in MB |
-MaxFileSizeMB |
0 (unlimited) | Maximum file size in MB |
-MaxNumberOfFiles |
100 | Total number of files to generate |
-MaxDepth |
5 | Maximum folder depth |
-MaxFolders |
5000 | Maximum number of folders |
-MaxFilesPerFolder |
5 | Maximum files per folder |
-EmptyFolderPercentage |
10 | Percentage of folders left empty |
-MaxTimestampDaysBack |
365 | Max days back for timestamp randomization |
-TargetPath |
./DummyFiles | Target folder path |
-AppendToExisting |
false | Preserve existing folder and add new content |
How It Works
- Downloads required CSV files (folders, files, fileNames) if not present
- Builds a folder structure based on the folder templates
- Downloads source files to a temp directory (cached for reuse)
- Copies and renames files to the target structure
- Randomizes timestamps on all created files
CSV File Formats
The script uses three CSV files (auto-downloaded if missing):
- folders.csv - Folder path templates (column:
Path) - files.csv - Source files (columns:
fileName,fileSize,downloadLink,category) - fileNames.csv - Random file names by category (columns:
category,fileName)
Requirements
- PowerShell 5.1 or later
- Internet connection (for initial CSV and file downloads)
License
MIT License - see LICENSE for details.