Definition: Declares the name, arguments, and code that form the body of a Functionprocedure.
You can define a function in Windows PowerShell by using the Functionstatement followed by:
· The name of the function.
· The task to be performed by the function (enclosed in curly braces).
For example, the following command defines a function named MultiplyNumbers. This function will take two arguments ($ args  and $ args) and multiply those two values. Here’s the command itself:
After a function has been defined you can call that function simply by specifying its name and (in this case) the two values you want multiplied:
When you run the preceding command you should get back the following: