A collection of reusable PowerShell functions developed to solve practical infrastructure and automation problems.
Many of these functions originated in day-to-day systems administration and later became part of larger PowerShell modules. They remain available here as standalone implementations so individual functions can be reviewed, reused, or adapted without importing an entire module.
The repository contains both historical Windows PowerShell utilities and newer code written for PowerShell 7+. Modernized functions are documented with their own compatibility requirements and, where appropriate, automated tests.
A PowerShell 7+ logging implementation for production automation with:
- INFO, WARNING, and ERROR severity levels
- file and console output
- pipeline input and multiline-message handling
- in-memory buffering with retrieve, flush, and clear operations
- named mutex protection for concurrent file writers
- configurable lock timeout and abandoned-mutex handling
- opt-in secret redaction
- explicit pass-through output
- private helper functions and Pester 5 tests
See New-LogEntry/ for documentation, source, tests, and change history.
The repository also contains standalone utilities including:
New-Timer— creates and starts aSystem.Diagnostics.StopwatchtimerGet-ElapsedTime— returns elapsed-time information for a stopwatchStop-Timer— stops an existing stopwatchGet-TimerStatus— returns the running state of a stopwatchNew-ApiRequest— helper for API calls using OAuth2 authenticationTest-IsGuid— validates GUID stringsConvert-EmlFile— converts.emlfiles into PowerShell objectsNew-StringConversion— handles selected string/character conversion scenariosTest-IsRegistryKey— validates registry keys for use byExport-RegistryExport-Registry— exports registry data to CSV or XMLTest-IsValidDn— validates Active Directory distinguished-name inputGet-UniqueUPN— generates or resolves unique UPN valuesTest-UpnExist— checks UPN existence
Some standalone functions predate the current PowerShell 7 modernization effort and may reflect the platform assumptions and coding practices of their original release. They are retained as part of the repository's history until each function is reviewed individually.
Current maintenance focuses on:
- PowerShell 7+ for newly modernized code
- explicit public/private boundaries where a function requires supporting helpers
- Pester tests for behavior that is actively maintained
- clearer compatibility and platform documentation
- preserving useful history without rewriting working code purely for stylistic reasons
Functions may later be incorporated into dedicated modules when that provides a clearer public API.
Unless a function states otherwise, repository content is released under the MIT License.