Put this in $PROFILE.CurrentUserAllHosts:
# Microsoft.PowerShell_profile.ps1 (CurrentUserAllHosts)
$dot = Join-Path $HOME 'dotfiles\profile.ps1'
if (Test-Path $dot) { . $dot }Run both lint and tests:
.\tools\ci.ps1Run only lint:
.\tools\ci.ps1 -LintOnlyRun only tests:
.\tools\ci.ps1 -TestOnlyInstall local git hooks:
.\tools\install-hooks.ps1Installed hooks:
pre-commit(lightweight no-op)commit-msg(runstools/ci.ps1)- hook logic is sourced from
modules/GitAliases.Extras/tools/hooks/*to avoid duplication
Checks are skipped when:
- commit message contains
[skip precommit hook]or[skip pch] - there are no working tree changes (for example,
git commit --allow-empty ...)
Recommended approach: keep this as dotfiles repo and move modules/GitAliases.Extras to its own repository, then consume it via git submodule at the same path.
Safe migration flow:
- Run a dry run:
.\tools\migrate-gitaliases-extras.ps1 -SubmoduleUrl 'git@github.com:<you>/GitAliases.Extras.git' -SubmoduleBranch main -PushSplit- Apply the migration:
.\tools\migrate-gitaliases-extras.ps1 -SubmoduleUrl 'git@github.com:<you>/GitAliases.Extras.git' -SubmoduleBranch main -PushSplit -Apply- Commit resulting changes in this repo (
.gitmodules+ submodule pointer).
Notes:
bootstrap.ps1now initializes submodules automatically if.gitmodulesexists.profile.ps1warns with the exactgit submodule update --init --recursivecommand if submodules were not initialized.
P.S. You can also install just GitAliases.Extras without dotfiles as standalone powershell package
PSScriptAnalyzerlinting withPSScriptAnalyzerSettings.psd1Pestertests intests\plusmodules\GitAliases.Extras\tests\- GitHub Actions matrix on:
- Windows PowerShell 5.1
- PowerShell 7