Skip to content

Files

Latest commit

28081e5 · Mar 17, 2025

History

History
34 lines (23 loc) · 615 Bytes
·

AvoidGlobalFunctions.md

File metadata and controls

34 lines (23 loc) · 615 Bytes
·
description ms.date ms.topic title
Avoid global functions and aliases
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 {}