Skip to content

AniTexs/My-PWSH-Modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

My-PWSH-Modules

Collection of PowerShell modules maintained in a single repository with automated build, test, and publish workflows.

πŸ“‹ Overview

This repository serves as a centralized collection of PowerShell modules. Each module is independently versioned and can be published to the PowerShell Gallery (PSGallery). The repository includes a comprehensive build system with automated testing, code analysis, and publishing capabilities.

πŸ“¦ Available Modules

Here you can view the Modules which currently exist in this Repository.

Module Name Description Link
PS.Capa.CapaOne Unofficial API Wrapper for CapaSystems CapaOne PS.Capa.CapaOne
PS.ElasticShell API Wrapper for interacting with ElasticSearch PS.ElasticShell

To see all modules, check the modules directory.

πŸš€ Getting Started

Prerequisites

  • PowerShell 7.0 or higher
  • Git
  • (Optional) Pester for testing
  • (Optional) PSScriptAnalyzer for code quality checks

Installation

Each module can be installed from PSGallery once published:

Install-Module -Name ModuleName -Repository PSGallery

Development Setup

  1. Clone this repository:

    git clone https://github.com/AniTexs/My-PWSH-Modules.git
    cd My-PWSH-Modules
  2. Explore the modules:

    Get-ChildItem ./modules
  3. Import a module locally:

    Import-Module ./modules/ModuleName/ModuleName.psd1

πŸ—οΈ Repository Structure

My-PWSH-Modules/
β”œβ”€β”€ modules/              # All PowerShell modules
β”‚   └── ModuleName/      # Individual module directory
β”œβ”€β”€ build/               # Build and automation scripts
β”œβ”€β”€ .github/workflows/   # GitHub Actions CI/CD
β”œβ”€β”€ docs/                # Documentation
β”œβ”€β”€ CONTRIBUTING.md      # Contribution guidelines
β”œβ”€β”€ LICENSE              # MIT License
└── README.md           # This file

For detailed information about module structure, see Module Structure Guide.

πŸ› οΈ Build and Test

This repository includes PowerShell scripts for building, testing, and publishing modules.

Build a Module

./build/Build-Module.ps1 -ModuleName YourModule

Run Tests

# Test a specific module
./build/Test-Module.ps1 -ModuleName YourModule

# Test all modules
./build/Test-All.ps1

Code Analysis

# Analyze a specific module
./build/Invoke-Analyzer.ps1 -ModuleName YourModule

# Analyze all modules
./build/Invoke-Analyzer.ps1

Publish to PSGallery

# First, build the module
./build/Build-Module.ps1 -ModuleName YourModule

# Then publish (requires PSGallery API key)
./build/Publish-Module.ps1 -ModuleName YourModule -ApiKey $env:PSGALLERY_API_KEY

πŸ”„ CI/CD Pipeline

This repository uses GitHub Actions for continuous integration and deployment:

  • CI Pipeline (ci.yml): Runs on every push and pull request

    • Builds all modules
    • Runs PSScriptAnalyzer
    • Executes all tests
    • Runs on Ubuntu, Windows, and macOS
  • Publish Pipeline (publish.yml): Publishes modules to PSGallery

    • Triggered by releases or manual workflow dispatch
    • Validates and builds the module
    • Publishes to PowerShell Gallery

Publishing a Module

To publish a module to PSGallery:

  1. Ensure your module version is updated in the manifest
  2. Create a release tag: ModuleName-v1.0.0
  3. The GitHub Action will automatically publish to PSGallery

Or use manual workflow dispatch with the module name.

🀝 Contributing

Important: This repository accepts contributions to existing modules only. New modules should be created in your own repository.

We welcome contributions that:

  • Fix bugs in existing modules
  • Improve existing module functionality
  • Enhance documentation
  • Add tests

We do not accept:

  • New modules (create your own repository instead)
  • Direct pushes of new modules

Please read CONTRIBUTING.md for detailed guidelines.

Quick Contribution Guide

  1. Fork the repository
  2. Create a feature branch (git checkout -b fix/your-fix)
  3. Make your changes to existing modules
  4. Run tests and ensure they pass
  5. Commit your changes (git commit -m 'Fix: description')
  6. Push to your fork (git push origin fix/your-fix)
  7. Open a Pull Request

πŸ“„ License

This repository and all modules within it are licensed under the MIT License. See LICENSE file for details.

MIT License

Copyright (c) 2025 Nicolai Jacobsen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

πŸ“š Documentation

πŸ”§ Maintenance

Adding a New Module (Repository Owner)

When adding a new module to this repository:

  1. Create the module directory: modules/ModuleName/
  2. Follow the Module Structure Guide
  3. Ensure the module has:
    • Module manifest (.psd1)
    • Module script file (.psm1)
    • README.md
    • Tests
  4. Test locally before committing
  5. Update this README to list the new module

πŸ› Issues and Support

If you encounter issues with any module:

  1. Check the module's README for documentation
  2. Search existing issues in this repository
  3. Open a new issue with:
    • Module name and version
    • Description of the issue
    • Steps to reproduce
    • Expected vs actual behavior

🌟 Acknowledgments

Thank you to all contributors who help improve these modules!

πŸ“ž Contact

For questions or discussions, please open an issue in this repository.


Note: If you've created your own PowerShell module, we encourage you to publish it in your own repository and share it with the PowerShell community independently!

Packages

No packages published

Contributors 2

  •  
  •