Closed
Description
Module auto-discovery is fastest when a module has entries for:
- AliasesToExport
- CmdletsToExport
- FunctionsToExport
- Does not use wildcards or $null in these entries.
During module auto-discovery, if any of these entries are missing or $null, PowerShell do some potentially expensive work to analyze the rest of the module (e.g. do reflection on a dll, or parse and analyze the psm1).
If these entries are all present and non null, then this extra work can be avoided and provide a better overall experience.
If one of these entries is missing, PSScriptAnalyzer should suggest adding an entry like:
FunctionsToExport = @()
If one of the entries uses wildcards, PSScriptAnalyzer should suggest replacing the wildcards with an explicit list.
The module type (script or binary) doesn't matter, these entries are needed for the best performance.