# 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:`).

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

Level: Freelancer · [More PowerShell terms at this level](https://www.ask-codey.com/glossary?category=powershell&level=4)

Updated: November 17, 2026

## In other subjects

- [Scope in C#](https://www.ask-codey.com/glossary/scope-c-sharp)
- [Scope in Java](https://www.ask-codey.com/glossary/scope-java)
- [Scope in JavaScript](https://www.ask-codey.com/glossary/scope-javascript)
- [Scope in Python](https://www.ask-codey.com/glossary/scope)

Source: https://www.ask-codey.com/glossary/scope-powershell
