Skip to content

Commit 5aa3286

Browse files
committed
Initial commit
0 parents  commit 5aa3286

22 files changed

+2221
-0
lines changed

.editorconfig

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# All files
7+
[*]
8+
charset = utf-8
9+
end_of_line = crlf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
# PowerShell files
14+
[*.{ps1,psd1,psm1}]
15+
indent_style = space
16+
indent_size = 4
17+
18+
# Markdown files
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
# JSON files
23+
[*.json]
24+
indent_style = space
25+
indent_size = 2
26+
27+
# XML files
28+
[*.xml]
29+
indent_style = space
30+
indent_size = 2
31+
32+
# YAML files
33+
[*.{yml,yaml}]
34+
indent_style = space
35+
indent_size = 2

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Build outputs
2+
/build/
3+
/output/
4+
/TestOutput/
5+
/ModuleExports/
6+
7+
# Test results
8+
TestResults.xml
9+
coverage.xml
10+
*.coverage
11+
*.trx
12+
13+
# User-specific files
14+
*.user
15+
*.suo
16+
*.cache
17+
.vs/
18+
19+
# PowerShell specific
20+
*.ps1xml
21+
!Types/*.ps1xml
22+
!Formats/*.ps1xml
23+
24+
# IDE
25+
.vscode/
26+
.idea/
27+
*.code-workspace
28+
29+
# OS files
30+
Thumbs.db
31+
.DS_Store
32+
desktop.ini
33+
34+
# Temporary files
35+
*.tmp
36+
*.temp
37+
*.log
38+
*.bak
39+
40+
# Package files
41+
*.nupkg
42+
*.zip
43+
*.tar.gz
44+
45+
# Sensitive data
46+
*.key
47+
*.pfx
48+
*.cer
49+
secrets.json
50+
config.local.json

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.1] - 2025-08-23
9+
10+
### Changed
11+
12+
- JSON output is now pretty-printed by default: removed `-Compress` from all `ConvertTo-Json` calls in both streaming and non-streaming export paths to improve readability.
13+
14+
## [1.0.0] - 2025-08-23
15+
16+
### Added
17+
18+
- Initial release of Export-ModuleInfoForLLM module
19+
- Support for exporting PowerShell module commands to JSON, Markdown, and XML formats
20+
- Parallel processing capability for improved performance
21+
- Batch export functionality for multiple modules
22+
- Streaming support for large datasets
23+
- Comprehensive command documentation extraction including:
24+
- Synopsis and descriptions
25+
- Parameters with types and validation
26+
- Examples with code and remarks
27+
- Related links and notes
28+
- Module availability testing function
29+
- Progress tracking and verbose logging
30+
- Error recovery and graceful failure handling
31+
32+
### Features
33+
34+
- `Export-ModuleCommandsForLLM` - Main export function
35+
- `Start-ParallelModuleExport` - Batch module export
36+
- `Test-ModuleAvailability` - Module availability checking
37+
38+
### Performance
39+
40+
- Parallel command processing within modules
41+
- Concurrent module exports
42+
- Streaming JSON for memory efficiency
43+
- Automatic compression for large datasets

CONTRIBUTING.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Contributing to Export-ModuleInfoForLLM
2+
3+
Thank you for your interest in contributing to Export-ModuleInfoForLLM! This document provides guidelines and instructions for contributing.
4+
5+
## Code of Conduct
6+
7+
By participating in this project, you agree to maintain a respectful and inclusive environment.
8+
9+
## Getting Started
10+
11+
### Prerequisites
12+
13+
- PowerShell 5.1 or PowerShell Core 7.x
14+
- Git
15+
- Pester 5.x for running tests
16+
- PSScriptAnalyzer for code analysis
17+
18+
### Development Setup
19+
20+
1. Fork the repository
21+
2. Clone your fork:
22+
```powershell
23+
git clone https://github.com/Warezloder/Export-ModuleInfoForLLM.git
24+
cd Export-ModuleInfoForLLM
25+
```
26+
27+
3. Install development dependencies:
28+
```powershell
29+
Install-Module -Name Pester -MinimumVersion 5.0 -Scope CurrentUser
30+
Install-Module -Name PSScriptAnalyzer -Scope CurrentUser
31+
```
32+
33+
4. Import the module for development:
34+
```powershell
35+
Import-Module .\Export-ModuleInfoForLLM.psd1 -Force
36+
```
37+
38+
## Development Guidelines
39+
40+
### Code Standards
41+
42+
- Follow the [PowerShell Practice and Style Guide](https://poshcode.gitbook.io/powershell-practice-and-style/)
43+
- Use approved verbs (`Get-Verb`)
44+
- Include comment-based help for all public functions
45+
- Add parameter validation
46+
- Implement proper error handling
47+
48+
### Testing
49+
50+
All contributions must include appropriate tests:
51+
52+
```powershell
53+
# Run all tests
54+
Invoke-Pester -Path .\Tests
55+
56+
# Run with code coverage
57+
Invoke-Pester -Path .\Tests -CodeCoverage .\Public\*.ps1, .\Private\*.ps1
58+
59+
# Run specific test file
60+
Invoke-Pester -Path .\Tests\Unit\Export-ModuleCommandsForLLM.Tests.ps1
61+
```
62+
63+
### Code Analysis
64+
65+
Run PSScriptAnalyzer before submitting:
66+
67+
```powershell
68+
Invoke-ScriptAnalyzer -Path . -Recurse -Settings PSGallery
69+
```
70+
71+
## Submission Process
72+
73+
### Pull Request Process
74+
75+
1. Create a feature branch:
76+
```powershell
77+
git checkout -b feature/your-feature-name
78+
```
79+
80+
2. Make your changes following the code standards
81+
82+
3. Add/update tests for your changes
83+
84+
4. Update documentation if needed
85+
86+
5. Run tests and ensure they pass:
87+
```powershell
88+
.\build.ps1 -Task Test
89+
```
90+
91+
6. Commit your changes:
92+
```powershell
93+
git commit -m "Add: Description of your changes"
94+
```
95+
96+
7. Push to your fork:
97+
```powershell
98+
git push origin feature/your-feature-name
99+
```
100+
101+
8. Create a Pull Request with:
102+
- Clear description of changes
103+
- Reference to any related issues
104+
- Test results summary
105+
106+
### Commit Message Format
107+
108+
Use conventional commits format:
109+
- `Add:` New feature
110+
- `Fix:` Bug fix
111+
- `Update:` Non-breaking change
112+
- `Breaking:` Breaking change
113+
- `Docs:` Documentation only
114+
- `Test:` Test additions/changes
115+
116+
## Project Structure
117+

Export-ModuleInfoForLLM.psd1

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
@{
2+
# Script module or binary module file associated with this manifest.
3+
RootModule = 'Export-ModuleInfoForLLM.psm1'
4+
5+
# Version number of this module.
6+
ModuleVersion = '1.0.1'
7+
8+
# Supported PSEditions
9+
CompatiblePSEditions = @('Desktop', 'Core')
10+
11+
# ID used to uniquely identify this module
12+
GUID = 'a7c4b8f2-3d5e-4f9a-b1c2-d3e4f5a6b7c8'
13+
14+
# Author of this module
15+
Author = 'Atticus M.'
16+
17+
# Company or vendor of this module
18+
CompanyName = 'Boro-Geek'
19+
20+
# Copyright statement for this module
21+
Copyright = '(c) 2024 amull. All rights reserved.'
22+
23+
# Description of the functionality provided by this module
24+
Description = 'PowerShell module for exporting module command information in LLM-friendly formats (JSON, Markdown, XML). Supports parallel processing for improved performance.'
25+
26+
# Minimum version of the PowerShell engine required by this module
27+
PowerShellVersion = '5.1'
28+
29+
# Functions to export from this module
30+
FunctionsToExport = @(
31+
'Export-ModuleCommandsForLLM',
32+
'Start-ParallelModuleExport',
33+
'Test-ModuleAvailability'
34+
)
35+
36+
# Cmdlets to export from this module
37+
CmdletsToExport = @()
38+
39+
# Variables to export from this module
40+
VariablesToExport = @()
41+
42+
# Aliases to export from this module
43+
AliasesToExport = @()
44+
45+
# Private data to pass to the module specified in RootModule/ModuleToProcess
46+
PrivateData = @{
47+
PSData = @{
48+
# Tags applied to this module for module discovery
49+
Tags = @('PowerShell', 'Module', 'Export', 'Documentation', 'LLM', 'AI', 'Automation')
50+
51+
# A URL to the license for this module.
52+
LicenseUri = ''
53+
54+
# A URL to the main website for this project.
55+
ProjectUri = ''
56+
57+
# ReleaseNotes of this module
58+
ReleaseNotes = '1.0.1: JSON output is now pretty-printed by default (removed -Compress from ConvertTo-Json in all paths).'
59+
60+
# Flag to indicate whether the module requires explicit user acceptance
61+
RequireLicenseAcceptance = $false
62+
}
63+
}
64+
}

Export-ModuleInfoForLLM.psm1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#Requires -Version 5.1
2+
using namespace System.Collections.Generic
3+
using namespace System.Text
4+
5+
Set-StrictMode -Version Latest
6+
$ErrorActionPreference = 'Stop'
7+
8+
# Check if we have the modular structure, otherwise load from parent
9+
$publicFunctions = @(Get-ChildItem -Path "$PSScriptRoot\Public\*.ps1" -ErrorAction SilentlyContinue)
10+
$privateFunctions = @(Get-ChildItem -Path "$PSScriptRoot\Private\*.ps1" -ErrorAction SilentlyContinue)
11+
12+
if ($publicFunctions.Count -gt 0 -or $privateFunctions.Count -gt 0) {
13+
# Load from modular structure
14+
foreach ($function in @($publicFunctions + $privateFunctions)) {
15+
try {
16+
Write-Verbose "Importing function: $($function.BaseName)"
17+
. $function.FullName
18+
}
19+
catch {
20+
Write-Error "Failed to import function $($function.FullName): $_"
21+
}
22+
}
23+
# Export public functions
24+
Export-ModuleMember -Function $publicFunctions.BaseName
25+
} else {
26+
# Load from single file in parent directory (temporary backward compatibility)
27+
$parentModulePath = Join-Path (Split-Path $PSScriptRoot -Parent) 'Export-ModuleInfoForLLM.psm1'
28+
if (Test-Path $parentModulePath) {
29+
Write-Verbose "Loading module from parent directory for backward compatibility"
30+
. $parentModulePath
31+
32+
# Note: The Export-ModuleMember at the end of the parent module file will handle exports
33+
# We don't need to re-export here as it's already done in the sourced file
34+
} else {
35+
Write-Error "No module functions found. Expected either:"
36+
Write-Error " - Functions in $PSScriptRoot\Public and $PSScriptRoot\Private"
37+
Write-Error " - Module file at $parentModulePath"
38+
throw "Module structure not found"
39+
}
40+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Senior Cat Hurder
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)