https://github.com/libre-devops/powershell-helpers
The home of the Libre DevOps PowerShell utilities module/library
https://github.com/libre-devops/powershell-helpers
Last synced: 11 months ago
JSON representation
The home of the Libre DevOps PowerShell utilities module/library
- Host: GitHub
- URL: https://github.com/libre-devops/powershell-helpers
- Owner: libre-devops
- License: mit
- Created: 2024-03-22T17:08:52.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-24T01:03:15.000Z (about 2 years ago)
- Last Synced: 2025-03-30T15:44:26.750Z (about 1 year ago)
- Language: PowerShell
- Size: 77.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# LibreDevOps Helpers
A collection of **PowerShell helper modules** that make day-to-day DevOps tasks less tedious and more repeatable.
The toolkit wraps common CLI utilities (Terraform, Checkov, Azure CLI, Chocolatey, Homebrew …) with idempotent, test-friendly PowerShell functions and includes a lightweight logging framework.
---
## Available Modules
| Module | Purpose |
|-----------------------------------------------|-----------------------------------------------------------------------------------|
| **AzureCliLogin** | Unified Azure CLI authentication (service-principal, OIDC, device-code, MSI) |
| **Checkov** | Safe wrapper for `checkov` scans with skip-lists, soft-fail, and structured logging |
| **Choco** | Assert that Chocolatey exists and install packages idempotently |
| **Homebrew** | Same as above but for Linux & macOS Homebrew |
| **Logger** | Opinionated logging (`INFO`, `WARN`, `DEBUG`, `ERROR`) with timestamps and invocation names |
| **Pester** | Thin helpers for writing module / pipeline tests |
| **Terraform** | End-to-end helpers: `Invoke-TerraformInit/Plan/Apply/Destroy`, workspace selection, plan → JSON, etc. |
| **TerraformDocs** | Sort `variables.tf`, `outputs.tf` & auto-generate **README.md** via `terraform-docs` |
| **Utils** | Generic helpers (type conversions, OS detection, program discovery, …) |
---
## Installation
```powershell
# Install from the PowerShell Gallery
Install-Module -Name LibreDevOpsHelpers -Scope CurrentUser
# Import the root module (nested modules auto-load)
Import-Module LibreDevOpsHelpers
```
### Prerequisites
Some functions call external CLIs (`terraform`, `checkov`, `az`, etc.).
Ensure those are available in your `$Env:PATH` or install them with the included `Assert-ChocoPath` / `Assert-HomebrewPath` helpers.
---
## Quick Start
```powershell
# Initialize Terraform and run a plan
$code = "C:\src\infra\terraform"
Invoke-TerraformInit -CodePath $code -InitArgs '-input=false'
Invoke-TerraformPlan -CodePath $code
Convert-TerraformPlanToJson -CodePath $code -PassThru | Invoke-Checkov
# Log in to Azure with a service-principal
Connect-AzureCli -UseClientSecret
```
---
## Using Individual Modules
```powershell
# Import everything
Import-Module LibreDevOpsHelpers
# Or cherry-pick only what you need:
Import-Module LibreDevOpsHelpers.Terraform
Import-Module LibreDevOpsHelpers.Logger
```
Each nested module is independent and exports only approved-verb cmdlets.
---
## Contributing
1. Fork the repo & create a feature branch
2. Follow the style guide:
```powershell
Get-Command -Module LibreDevOpsHelpers | Sort-Object Verb, Noun
```
3. Add Pester tests where applicable
4. Open a PR — GitHub Actions will lint, test, and publish preview packages
---
## License
This project is licensed under the [MIT License](https://raw.githubusercontent.com/libre-devops/powershell-helpers/main/LICENSE).
___
Made with ❤️ by **Libre DevOps**.