# Function

say it: **“FUNGK-shun”** **/ˈfʌŋkʃən/**

A named, reusable block of code.

## What is **Function**?

A **function** is a named, reusable block of PowerShell code.

```powershell
function Get-Greeting($Name) {
    "Good morning, $Name!"
}

Get-Greeting -Name 'Maria'
```

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

Updated: November 17, 2026

## In other subjects

- [Function in JavaScript](https://www.ask-codey.com/glossary/function)
- [Function in Python](https://www.ask-codey.com/glossary/function-python)

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