description | ms.custom | ms.date | ms.topic | title |
---|---|---|---|---|
Avoid global functions and aliases |
PSSA v1.22.0 |
06/28/2023 |
reference |
AvoidGlobalFunctions |
Severity Level: Warning
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
.
Use other scope modifiers for functions.
function global:functionName {}
function functionName {}