feat: add short interactive aliases for common cmdlets#30
Merged
Conversation
Adds 13 short aliases targeting cmdlets used interactively rather than aliasing the full module surface. Aliases follow the ct/cf prefix convention and are exported via AliasesToExport in the module manifest. The three existing compatibility aliases are retained. New aliases: ctb64 -> ConvertTo-Base64 cfb64 -> ConvertFrom-Base64ToString cthash -> ConvertTo-Hash cthmac -> ConvertTo-HmacHash cturl -> ConvertTo-EscapedUrl cfurl -> ConvertFrom-EscapedUrl ctut -> ConvertTo-UnixTime cfut -> ConvertFrom-UnixTime gut -> Get-UnixTime ctc -> ConvertTo-Celsius ctf -> ConvertTo-Fahrenheit cttc -> ConvertTo-TitleCase ctstr -> ConvertTo-String Closes #26
Adds an Alias context to each affected cmdlet's test file that asserts the short alias resolves to the correct function. This prevents aliases being silently removed or remapped in future. Updates Global.Tests.ps1 to assert 16 exported aliases (was 3) with full metadata verification for each new alias. Migrates remaining -TestCases usages to -ForEach across Global.Tests.ps1, ConvertTo-Hash.Tests.ps1, and ConvertTo-HmacHash.Tests.ps1 for consistency with the Pester 5 idiomatic pattern used elsewhere.
austoonz
force-pushed
the
feat/cmdlet-aliases
branch
from
June 26, 2026 22:07
d9538fb to
f5e2328
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 13 short
ct/cf-prefixed aliases targeting cmdlets used interactively. The full module surface is not aliased — MemoryStream, CompressedByteArray, HashTable, and SecureString cmdlets are excluded as they are primarily used inside scripts where full names aid readability.The three existing compatibility aliases (
ConvertFrom-Base64StringToByteArray,ConvertFrom-ByteArrayToBase64String,ConvertFrom-StreamToString) are retained.ctb64ConvertTo-Base64cfb64ConvertFrom-Base64ToStringcthashConvertTo-HashcthmacConvertTo-HmacHashcturlConvertTo-EscapedUrlcfurlConvertFrom-EscapedUrlctutConvertTo-UnixTimecfutConvertFrom-UnixTimegutGet-UnixTimectcConvertTo-CelsiusctfConvertTo-FahrenheitcttcConvertTo-TitleCasectstrConvertTo-Stringcfb64targetsConvertFrom-Base64ToString(notConvertFrom-Base64) because it has lenient mode — UTF-8 with Latin-1 fallback when no encoding is specified — making it more forgiving for interactive use.All aliases were verified against the PowerShell Gallery with
Find-Module -Command— no collisions found.Closes #26
Test plan
Global.Tests.ps1asserts 16 exported aliases with full metadata verification (source, version, resolved command, visibility) for eachAliascontext that asserts the short alias resolves to the correct function — prevents silent removal or remapping-TestCasesusages migrated to-ForEachinGlobal.Tests.ps1,ConvertTo-Hash.Tests.ps1, andConvertTo-HmacHash.Tests.ps1.\build.ps1 -PowerShell -Testto confirm all tests pass🤖 Generated with Claude Code