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.
From the repository root, in PowerShell 7.1 or later:
# Load the logging implementation and collect one entry in memory.
. ./New-LogEntry/New-LogEntry.ps1
New-LogEntry -LogMessage 'Daily report started' -BufferOnly
New-LogEntry -GetBuffer
New-LogEntry -ClearBufferThe buffer returns one timestamped INFO entry; the final command clears it.
This example does not create a log file or import the IT-ToolBox module.
| Scope | Requirements | Verification |
|---|---|---|
| Standalone functions; compatibility varies by function | The logger example supports PowerShell 7.1+ on Windows, Linux and macOS; other implementations have their own requirements | See each function's tests and compatibility notes; there is no single release version for the whole collection |
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 standalone OAuth-style request helper now follows the IT-ToolBox implementation. It requires PowerShell 7.4+, defaults to a form POST, supports dictionary headers and prevents client secrets from entering GET URLs. See usage and migration notes and tests. No module installation is required.
New-StringConversion, Test-IsEmail, Test-IsValidDn and Get-ElapsedTime now use the IT-ToolBox implementations with a PowerShell 7.4 baseline. Dot-source the existing root files as before, keeping Private/ alongside them. No IT-ToolBox installation is required. See alignment and migration notes and tests.
Get-UniqueUPN and Test-UPNExist now use explicit forest/domain lookup scope, escaped LDAP equality filters, bounded collision checks and independent name formatting. Generated names now follow the same ASCII username and DNS/IDN suffix policy as Test-IsValidUpn; unsupported names require explicit normalization. Test-IsValidUpn is also available standalone. They require PowerShell 7.4; actual lookups additionally require the ActiveDirectory module and directory connectivity. See usage and compatibility notes. These are availability checks, not atomic reservations.
Cross-platform MIME parsing now replaces the Windows-only COM result with detached message objects. Requires PowerShell 7.4 and explicit installation of pinned MimeKitLite: ./scripts/Install-EmlDependency.ps1. Parsing itself never downloads dependencies. See output schema and migration notes, especially changes from CDO.Message.
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— parses local MIME messages into detached 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.