Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 640 Bytes

AvoidGlobalFunctions.md

File metadata and controls

36 lines (24 loc) · 640 Bytes
description ms.custom ms.date ms.topic title
Avoid global functions and aliases
PSSA v1.22.0
06/28/2023
reference
AvoidGlobalFunctions

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 {}