# Script Block

say it: **“skript BLOK”** **/ˌskrɪpt blɒk/**

Code in \`{ }\` that can be stored and run later.

## What is **Script Block**?

A **script block** is a chunk of code in curly braces `{ }` that can be stored and run later. `Where-Object` and `ForEach-Object` take script blocks.

```powershell
$greet = { param($name) "Hi, $name" }
& $greet 'Maria'
```

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

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/script-block
