# Array Index

*noun*

say it: **“uh-RAY IN-deks”** **/əˈreɪ ˈɪndɛks/**

A number that says where an item sits in a list, starting from 0 for the first item.

## What is an **array index** in PowerShell?

An **array index** is an item's position in a list, counted from 0 and written in square brackets after the array's name. `[0]` is the first item, `[1]` the second, and `[-1]` the last, so you can reach the end without counting.

```powershell
$machines = 'kettle-bot', 'oil can', 'clock', 'gearbox', 'bell'
$machines[0]     # kettle-bot
$machines[-1]    # bell
```

## In a sentence

- “The **array index** 0 gave the first machine on the list, the kettle-bot.”
- “Ada used the **array index** -1 to get the last job of the day.”

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

Updated: November 10, 2026

## In other subjects

- [Array Index in C#](https://www.ask-codey.com/glossary/array-index-c-sharp)
- [Array Index in Java](https://www.ask-codey.com/glossary/array-index)
- [Array Index in JavaScript](https://www.ask-codey.com/glossary/array-index-javascript)
- [Array Index in Unix](https://www.ask-codey.com/glossary/array-index-unix)

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