This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
PSF-Module is a PowerShell utility module published to the PowerShell Gallery. It follows a specific architecture where each function is implemented as a separate file in the functions/ directory and explicitly imported through PSF.psm1. The module manifest (PSF.psd1) controls which functions are exported publicly.
- Run all tests:
pwsh .\.ExecuteTests.ps1 - Validate module manifest:
Test-ModuleManifest -Path .\PSF.psd1
- Test module import locally:
Import-Module .\PSF.psd1 -Force - Check exported functions:
Get-Command -Module PSF
The module requires three files to stay synchronised when adding/modifying functions:
functions/FunctionName.ps1- Function implementationPSF.psm1- Must dot-source the function:. $PSScriptRoot\functions\FunctionName.ps1PSF.psd1- Must list function inFunctionsToExportarray
PSF.psm1explicitly dot-sources each function file (no wildcards)- Only functions listed in
FunctionsToExportin the manifest are publicly available - Functions not in both places will either not load or not be accessible
- Each function should have a corresponding test file:
tests/FunctionName.Tests.ps1 - Tests use Pester framework
- The
.ExecuteTests.ps1script auto-installs Pester if missing
- Uses GitVersion with conventional commit patterns:
(BREAKING CHANGES?|major): Major version bump(feature|minor|feat): Minor version bump(fix|patch|hotfix): Patch version bump(build|chore|ci|doc|docs|none|perf|refactor|skip|test): No version bump
- Tests run on push/PR to master
- On master branch: GitVersion calculates new version
- Module manifest updated with new version and current year
- Module files staged to
Modules/PSF/directory - Published to PowerShell Gallery using
Publish-Module
When adding a new function, you must update all three locations:
- Create
functions/New-FunctionName.ps1 - Add
. $PSScriptRoot\functions\New-FunctionName.ps1toPSF.psm1 - Add
'New-FunctionName'toFunctionsToExportarray inPSF.psd1 - Create
tests/New-FunctionName.Tests.ps1with Pester tests
- No external dependencies beyond standard PowerShell modules
- No wildcards in function exports (explicit listing required)
- Avoid functions that trigger antivirus false positives
- Module is self-contained for PowerShell Gallery distribution