███████████ █████
░█░░░███░░░█░░███
░ ░███ ░ ░███████ ██████
░███ ░███░░███ ███░░███
░███ ░███ ░███ ░███████
░███ ░███ ░███ ░███░░░
█████ ████ █████░░██████
░░░░░ ░░░░ ░░░░░ ░░░░░░
███████ ████ ███ █████
███░░░░░███ ░░███ ░░░ ░░███
███ ░░███ ████████ ░███ ████ ██████ █████ ███████
░███ ░███░░███░░███ ░███ ░░███ ███░░███ ███░░ ░░░███░
░███ ░███ ░███ ░███ ░███ ░███ ░███████ ░░█████ ░███
░░███ ███ ░███ ░███ ░███ ░███ ░███░░░ ░░░░███ ░███ ███
░░░███████░ ████ █████ █████ █████░░██████ ██████ ░░█████
░░░░░░░ ░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░░░
██████ ██████ █████ █████ █████ ███
░░██████ ██████ ░░███ ░░███ ░░███ ░░░
░███░█████░███ ██████ ███████ ███████ ██████ █████ ███████ ████ ██████
░███░░███ ░███ ░░░░░███ ░░░███░ ░░░███░ ░░░░░███ ███░░ ░░░███░ ░░███ ███░░███
░███ ░░░ ░███ ███████ ░███ ░███ ███████ ░░█████ ░███ ░███ ░███ ░░░
░███ ░███ ███░░███ ░███ ███ ░███ ███ ███░░███ ░░░░███ ░███ ███ ░███ ░███ ███
█████ █████░░████████ ░░█████ ░░█████ ░░████████ ██████ ░░█████ █████░░██████
░░░░░ ░░░░░ ░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░ ░░░░░ ░░░░░░ PowerCat is a single‑shot concatenator for bundling markdown and code into one clean text file.
It’s the feline cousin of cat—polished for PowerShell, Markdown‑aware, and built with recruiter‑friendly ergonomics.
- Concatenation: Bundle multiple filetypes into a single output file.
- Recursion: Include subdirectories with
-Recurse. - Markdown fences: Opt‑in code fencing with
-Fencefor clean LLM/GitHub sharing. - Extensions: Default as Markdown plus switches (
-Bash,-PowerShell,-HTML,-CSS) or custom list via-Extensions. - Sorting: Control order with
-Sort Name|Extension|LastWriteTime|Length. - Aliases: Quick commands
PowerCat,pcat,concatpoint toInvoke-PowerCat. - Native help: Rich comment‑based help available via
Get-Help Invoke-PowerCat.
- Initial release of PowerCat.
- Changed license from CC0-1.0 to GPL v3.
- Minify parameter (
-Minify,-mini): Remove comments and blank lines from output for cleaner code bundles. - HeaderFormat parameter (
-HeaderFormat,-hf): Specify output header format—Markdown (default), JSON, or YAML. - MinSize parameter (
-MinSize,-min): Exclude files smaller than specified size in bytes. - MaxSize parameter (
-MaxSize,-max): Exclude files larger than specified size in bytes.
- Fixed Pester tests for cross-platform compatibility (Linux/macOS/Windows).
- Updated module import paths to use forward slashes (
/) instead of backslashes (\). - Replaced
$env:TEMPwith/tmpfor Linux systems where environment variable is unavailable. - Added
-Rawflag toGet-Contentcalls for proper multi-line regex matching in test assertions.
- Enhanced test robustness across different operating systems.
- All 16 Pester tests now pass on Linux systems.
- Comprehensive test coverage for new features (minification, custom headers, size filtering).
- Binary file detection: Automatically skips common binary formats (
.exe,.dll,.zip, images, media, archives, databases, etc.) to prevent concatenation errors. - Output directory validation: Verifies output directory exists and is writable before processing files.
- Parameter validation: Added
ValidateRangeattributes to-MinSizeand-MaxSizefor input integrity.
- Fixed minify filter regex from character class
[#//](matching individual characters) to explicit patterns^#and^//for proper comment filtering. - Improved path separator handling with
DirectorySeparatorCharandAltDirectorySeparatorCharfor better cross-platform compatibility. - Fixed
-MinSizevalidation logic (changed from-ne 0to-gt 0). - Added path expansion for user-provided
-CatIgnoreparameter (supports~and relative paths).
- Efficiency: Refactored file reading loop to use single
Get-ChildItemscan instead of per-extension loops; consolidated output into string array and write once withSet-Content. - Error handling: Added comprehensive try-catch blocks around file I/O operations with descriptive error messages.
- UTF-8 encoding: Specified UTF-8 encoding for all file reads and writes for consistent cross-platform text handling (no BOM).
- Module ergonomics: Removed
-Helpswitch from module (PowerShell-idiomatic); users rely onGet-Help Invoke-PowerCatfor native PowerShell help discovery. - Cross-platform paths: Added
GetUnresolvedProviderPathFromPSPathfor proper tilde (~) and relative path expansion on all platforms.
- Breaking change:
-OutputFileparameter is now optional (was mandatory). Default behavior outputs to stdout, matching Unixcatconvention. - Removed confirmation message from file output (
Write-Host).
- Stdout output: Invoke-PowerCat now outputs concatenated content to stdout by default, enabling Unix-style piping and redirection.
- Example:
Invoke-PowerCat -s ./src | Out-File bundle.txt(manual redirection) - Example:
Invoke-PowerCat -s ./src -o bundle.txt(direct file output, optional)
- Example:
- Fixed
-OutputFilepath expansion to only occur when parameter is provided, preventing erroneous directory resolution on stdout-only invocations. - Corrected test suite to validate both stdout and file-output behaviors.
- Implicit Markdown removed: PowerCat no longer includes
.mdfiles by default. Users must explicitly opt-in with-IncludeMarkdownor-Extensions ".md". This avoids accidentally bundling documentation and makes automated workflows safer.
-IncludeMarkdown: explicit switch to include.mdfiles.-ExcludeExtensions: exclude specific extensions from selection (accepts comma-separated lists).-ForceOverwrite(-forcealias for script): remove existing read-only output files when present and explicitly requested.- Support for comma-separated
-Extensionsstrings for convenience (e.g.-Extensions ".ps1,.md").
- Positional
SourceDiris required for clarity (first positional parameter). - Script and module parity tightened; script wrapper mirrors module behaviors and accepts the same flags.
- Tests expanded to cover new behaviors and script parity; all tests pass.
- This release is a breaking change due to the removal of implicit Markdown inclusion. Update automation or scripts to pass
-IncludeMarkdownwhere.mdfiles are required.