Search notes:

PowerShell: Script block

A script block is essentially an anonymous function (see functions seem to be a script block) and thus consists of a series of statements and expressions. It accepts arguments and might return a value.
A script block is category of commands as are for example functions or «ordinary» scripts.
A script block is identified by the curly brackets that contain it. In PowerShell, anything within curly brackets, except hash tables, are script blocks.
A script block is an instance of the .NET framework type System.Management.Automation.ScriptBlock:
PS C:\> {}.GetType().FullName
System.Management.Automation.ScriptBlock
As any other object, a script block can be assigned to a variable.
The script block that the variable references can then be called with the call operator (&) (See here).
A script block that is assigned to a variable might also be invoked with the invoke-command cmdLet.
Script blocks might be also used as a scheduled job (that was started with start-job).
Within a pipeline, a script block can be executed for each element in the pipeline with the forEach-object cmdLet.

See also

The time a script block needs until it is finished can be measured with the measure-command cmdLet.
The automatic variable $psItem (for which $_ is an alias).
The script block is only recognized in argument parsing mode
A dynamic module can be created from a script block with new-module.

Index