Search notes:

PowerShell: function statement

The function statement creates functions.

Show definition of function

# define a function ...

function foo {
  echo 'foo'
  ls
}

# ... and show its definition:

$function:foo
Github repository about-powershell, path: /language/statement/function/show-definition.ps1

See also

Function parameters
A function's begin, process and end block
Others statements
The automatic variable $psCmdlet and the preference variable $maximumFunctionCount.
A function is an item that is exposed through the function provider.
The body (or definition) of a function (such as mkdir) can be shown with (get-command mkdir).definition.

Index