# Acting on Each

Acting on Each: Doing Something to Each: ForEach-Object, Columns You Make Yourself: Calculated Properties.

Updated: November 10, 2026

1. [Doing Something to Each: ForEach-Object](https://www.ask-codey.com/lessons/powershell-foreach-object) (Apprentice): ForEach-Object runs a script block once for every object the pipeline hands it, with $\_ as this item, so one line can rename 200 photos, and -WhatIf goes inside the braces, on the command that makes the change, so you can rehearse first.
2. [Columns You Make Yourself: Calculated Properties](https://www.ask-codey.com/lessons/powershell-calculated-properties) (Journeyman): A calculated property is a column you add to Select-Object yourself, written as a hashtable with a Name for the heading and an Expression that works the value out for each object, such as a file's size in megabytes, rounded with \[math\]::Round.

Source: https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-acting-on-each
