Scope

say it: “skohp” /skoʊp/

Where a variable is visible: local, script or global.

What is Scope?

Scope decides where a variable can be seen: inside a function (local), the whole script ($script:), or everywhere ($global:).

$script:counter = 0
function Add-One { $script:counter++ }

Level: Freelancer · More PowerShell terms at this level

Updated

In other subjects