AvoidGlobalFunctions
Severity Level: Warning
Description
Globally scoped functions override existing functions within the sessions with matching names. This name collision can cause difficult to debug issues for consumers of modules.
To understand more about scoping, see Get-Help about_Scopes
.
How
Use other scope modifiers for functions.
Example
Wrong
function global:functionName {}
Correct
function functionName {}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for