-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
- Make a module, and set Prefix to 'Test'
Import-Module MyTestModule -Prefix ''- All commands will still have test prefix
This is because the prefix test checks for IsNullOrEmpty instead of just null.
bool usePrefix = !string.IsNullOrEmpty(prefix);
As such it is impossible to override the prefix which affects the ability to write pester tests on modules, etc. and use the original function names so that things like references and go to definition work in IDEs like vscode.
Workaround
Make a secondary manifest that references the same module but does not have the prefix specified.
Expected behavior
Commands without prefixActual behavior
Commands have default prefixError details
No response
Environment data
PS 7.2.1Visuals
No response
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module