PSScriptTools icon indicating copy to clipboard operation
PSScriptTools copied to clipboard

Get prefixed cmdlets

Open cdhunt opened this issue 4 years ago • 3 comments

It looks like this is only an issue for binary cmdlets and ToString() on the CmdletInfo object returns the prefixed command name.

Fixes #112

cdhunt avatar Jul 08 '21 15:07 cdhunt

This doesn't work on exported functions in PowerShell 7. The only way Get-ModuleCommand works as expected in PowerShell 7 is if you first import the module so that the prefix is applied.

jdhitsolutions avatar Jul 08 '21 16:07 jdhitsolutions

The prefix can be pulled from $mod.prefix and I guess some string formatting can be done where $PSVersionTable.PSVersion -ge 7.0?

cdhunt avatar Jul 08 '21 17:07 cdhunt

Since Microsoft agrees there is a PowerShell 7 bug, I'm going to hold off on doing anything. This is only an issue when using -ListAvailable in PowerShell 7. This isn't a problem if the module has been imported with the prefix first.

jdhitsolutions avatar Jul 08 '21 18:07 jdhitsolutions

Ignoring the issue for now, and this PR is so far out of alignment with the current state of the project with too many merge conflicts to manage.

jdhitsolutions avatar Mar 06 '23 15:03 jdhitsolutions