ExpressionCache

0.3.0-beta1

Lightweight, extensible caching for PowerShell.

Minimum PowerShell version

5.1

This is a prerelease version of ExpressionCache.
There is a newer prerelease version of this module available.
See the version list below for details.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name ExpressionCache -RequiredVersion 0.3.0-beta1 -AllowPrerelease

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name ExpressionCache -Version 0.3.0-beta1 -Prerelease

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

© 2025-2026 Gary McNickle. MIT.

Package Details

Author(s)

  • Gary McNickle

Tags

caching powershell scriptblock

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

## [0.3.0] - 2026-04-15
### Breaking Changes
- Redis provider: config key renamed from `Host` to `HostAddress` to match the `New-RedisClient` parameter name.
- Redis provider: default password changed from `'ChangeThisPassword!'` to `''` (empty). Set `$env:EXPRCACHE_REDIS_PASSWORD` or pass `Password` explicitly in config.

### Added
- **Thread safety**: `ReaderWriterLockSlim` for provider state, per-key `SemaphoreSlim` gates for single-flight cache operations.
- **PowerShell 5.1 compatibility**: replaced all `[type]::new()` calls with `New-Object`; added `Invoke-ParallelRunspace` helper for PS 5.1 concurrent tests.
- **Test coverage**: added test suites for `Get-ExpressionCacheProvider`, `Remove-ExpressionCacheProvider`, `Set-ProviderConfig`, `Set-ProviderStateValues`, `With-ProviderLock`, `ProviderStateAndConfig`, and `ConfigMerge` (7 new test files, 87 total tests).
- **Redis test infrastructure**: auto-detection of Redis via Docker or local `redis-cli`, isolated test prefix per run, skip logic for environments without Redis.
- Configurable `JsonDepth` with truncation warnings for deep object graphs.

### Fixed
- `Merge-ObjectDeep`: fixed `-or` to `-and` for map type check; array-wrapped `.Keys` to prevent enumeration bugs.
- `Get-FromLocalFileSystem`: added `-ErrorAction Stop` to `Get-Item` so TOCTOU race is caught by the existing `try/catch` (PS 5.1 non-terminating error fix).
- Redis provider: removed duplicate `Get-RedisClient` function that shadowed the client initializer (caused by `Ensure-RedisClient` rename collision).
- Redis provider: fixed `Use-RedisClient` leaking the client object into the pipeline.
- Redis provider: suppressed unwanted output from lazy client initialization.
- `Initialize-ExpressionCache`: fixed output leaking to pipeline.
- Naming inconsistencies across module (standardized to PowerShell approved verbs where possible).
- Temp file cleanup in `LocalFileSystem` provider.

### Changed
- Redis provider documentation rewritten to accurately reflect capabilities (native RESP protocol, thread-safe init, sliding TTL, SCAN-based clearing, envelope serialization with gzip).

FileList

Version History

Version Downloads Last updated
0.3.1-beta2 3 4/16/2026
0.3.0-beta2 2 4/16/2026
0.3.0-beta1 (current version) 2 4/16/2026
0.2.0-beta1 7 8/22/2025
0.1.2-beta1 6 8/20/2025
0.1.1-beta1 5 8/19/2025
0.1.0-beta1 4 8/19/2025
Show more