Skip to content

About

A repository containing all functions usually part of my modules

Resources

Stars

30 stars

Watchers

1 watching

Forks

Latest commit

 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PowerShell-Functions

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.

Modernized functions

New-LogEntry

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.

New-ApiRequest

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.

String conversion, email/DN validation and elapsed time

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.

UPN generation and directory lookup

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.

Convert-EmlFile

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.

Standalone functions

The repository also contains standalone utilities including:

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.

Direction

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.

License

Unless a function states otherwise, repository content is released under the MIT License.

About

A repository containing all functions usually part of my modules

Resources

Stars

30 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages