Skip to content

Warezloder/Export-ModuleInfoForLLM

Repository files navigation

Export-ModuleInfoForLLM

PowerShell License: MIT PSGallery

A PowerShell module for exporting comprehensive module command information in formats optimized for Large Language Model (LLM) consumption and training.

πŸš€ Features

  • Multiple Export Formats: JSON, Markdown, and XML support
  • Parallel Processing: Leverages PowerShell jobs for improved performance
  • Batch Processing: Export multiple modules simultaneously
  • Streaming Support: Handle large datasets efficiently with streaming JSON
  • Comprehensive Documentation: Captures synopsis, description, parameters, examples, and more
  • Progress Tracking: Visual feedback during processing
  • Error Recovery: Graceful handling of processing failures

πŸ“‹ Requirements

  • PowerShell 5.1 or later
  • Windows PowerShell or PowerShell Core/7.x

πŸ“¦ Installation

From PowerShell Gallery

Install-Module -Name Export-ModuleInfoForLLM -Scope CurrentUser

From GitHub

# Clone the repository
git clone https://github.com/Warezloder/Export-ModuleInfoForLLM.git

# Import the module
Import-Module .\Export-ModuleInfoForLLM\Export-ModuleInfoForLLM.psd1

🎯 Quick Start

Export a Single Module

# Export to JSON (default)
Export-ModuleCommandsForLLM -ModuleName "Microsoft.PowerShell.Management" `
    -OutputDirectory "C:\Exports" `
    -FileName "Management-Commands"

# Export to Markdown for documentation
Export-ModuleCommandsForLLM -ModuleName "Microsoft.PowerShell.Utility" `
    -OutputDirectory "C:\Exports" `
    -FileName "Utility-Docs" `
    -Format "Markdown"

Export Multiple Modules

# Export multiple modules in parallel
$modules = @("Microsoft.PowerShell.Management", "Microsoft.PowerShell.Utility")
Start-ParallelModuleExport -ModuleNames $modules `
    -OutputDirectory "C:\Exports" `
    -Format "JSON"

Test Module Availability

# Check if a module is available before export
if (Test-ModuleAvailability -ModuleName "VMware.VimAutomation.Core") {
    Export-ModuleCommandsForLLM -ModuleName "VMware.VimAutomation.Core" `
        -OutputDirectory "C:\Exports" `
        -FileName "VMware-Core"
}

πŸ“– Advanced Usage

Streaming Large Modules

For modules with hundreds of commands, use streaming to reduce memory usage:

Export-ModuleCommandsForLLM -ModuleName "LargeModule" `
    -OutputDirectory "C:\Exports" `
    -FileName "Large-Module" `
    -UseStreaming `
    -MaxConcurrentJobs 16

Batch Export with Pipeline

# Export all VMware modules
Get-Module -ListAvailable -Name "VMware*" |
    Select-Object -ExpandProperty Name |
    Start-ParallelModuleExport -OutputDirectory "C:\VMwareExports" `
        -Format "Markdown" `
        -MaxConcurrentModules 5

Using Helper Scripts

# Use the batch export script for pattern matching
.\Scripts\Export-MultipleModules.ps1 -ModulePattern "Microsoft.PowerShell.*" `
    -OutputDirectory ".\Exports" `
    -Format "JSON" `
    -MaxConcurrent 3

βš™οΈ Configuration Options

Export-ModuleCommandsForLLM Parameters

Parameter Type Description Default
ModuleName String Module to export Required
OutputDirectory String Output location Required
FileName String Output filename (without extension) Required
Format String Export format (JSON/Markdown/XML) JSON
MaxConcurrentJobs Int Parallel job limit 8
UseStreaming Switch Enable streaming for large datasets False
SkipProgressBar Switch Disable progress display False

πŸ“Š Performance Considerations

  • MaxConcurrentJobs: Adjust based on system resources (default: 8)
  • MaxConcurrentModules: For batch exports (default: 3)
  • UseStreaming: Enable for modules with 100+ commands
  • SkipProgressBar: Disable progress for automated scenarios

πŸ§ͺ Testing

Run the test suite:

# Run all tests
Invoke-Pester -Path .\Tests

# Run with code coverage
Invoke-Pester -Path .\Tests -CodeCoverage .\Public\*.ps1, .\Private\*.ps1

πŸ“ Output Formats

JSON

Structured data ideal for programmatic consumption and LLM training:

  • Comprehensive command metadata
  • Nested parameter information
  • Formatted examples with code blocks

Markdown

Human-readable documentation with proper formatting:

  • GitHub-compatible markdown
  • Syntax highlighting for code examples
  • Hierarchical command organization

XML

PowerShell's native serialization format:

  • Complete object serialization
  • Import with Import-Clixml

🀝 Contributing

Please see CONTRIBUTING.md for development setup and guidelines.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ› Issues and Support

For bugs, feature requests, or questions:

  • Open an issue on GitHub Issues
  • Check existing issues before creating a new one

πŸ™ Acknowledgments

  • PowerShell community for best practices and standards
  • Contributors and testers

πŸ“ˆ Roadmap

  • Add support for custom output templates
  • Implement caching for improved performance
  • Add support for remote module analysis
  • Create GUI for interactive exports
  • Add export scheduling capabilities

Note: This module is designed for documentation and LLM training purposes. Always review exported data for sensitive information before sharing.

About

A PowerShell module for exporting comprehensive module command information in formats optimized for Large Language Model (LLM) consumption and training.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages