Modules.PSOneTools icon indicating copy to clipboard operation
Modules.PSOneTools copied to clipboard

Switch to approved verbs & add aliases

Open God-damnit-all opened this issue 3 years ago • 2 comments

Originally I was proposing https://github.com/TobiasPSP/Modules.PSOneTools/pull/9; then I remembered the unapproved verb warnings I've been suppressing from PowerShell 7.

The functions have been renamed using the approved verb Invoke, and with their previous function name added as an alias. Additionally, each function has a 2nd alias that is much shorter, for faster use.

Function Renamed to... 2nd alias
Foreach-ObjectFast Invoke-PSOneForeach ForEachObj
Where-ObjectFast Invoke-PSOneWhere WhereObj
Group-ObjectFast Invoke-PSOneGroup GroupObj

God-damnit-all avatar Dec 31 '21 20:12 God-damnit-all

Because I changed PSOneTools.psd1 to UTF-8 so that GitHub would stop interpreting it as a binary file (it was UTF-16 LE before) it caused a merge conflict with #7, so I went ahead and incorporated it. Just a minor release note fix.

God-damnit-all avatar Dec 31 '21 22:12 God-damnit-all

Today I learned that aliases are allowed to have symbols in them. Maybe F% and F? for the fast foreach and fast where would be good additions?

Also, a brief tangent not necessarily related to this PR: you can even start aliases with two forward slashes, which would be an interesting way to add very short aliases in a cross-platform compatible way.

God-damnit-all avatar Jan 01 '22 18:01 God-damnit-all