Expand Minimize

SPC229101: AliasesToExport, CmdletsToExport, FunctionsToExport and VariablesToExport should be declared either empty or with exports only

Incorrectly defining the exports slows down the compilers module auto-discovery task.

CheckId SPC229101
TypeName DoNotUseWildcardsOrNullInExports
Severity Warning
Type PoShFile

Bad Practice

# Empty export
FunctionToExport = $null
# Populated export
FunctionToExport = '*'
Good Practice
# Empty export
FunctionToExport = @()
# Populated export
FunctionToExport = @(Get-Foo, Set-Foo)

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.