Learn About Powershell Define Function In Brief.

Asked By 5 points N/A Posted on -
qa-featured

Hello all,

I have a query regarding powershell define function. I want to ask how to define a function in Windows PowerShell.

Can someone tell me about this, please?

SHARE
Answered By 0 points N/A #299320

Learn About Powershell Define Function In Brief.

qa-featured

A block or excerpt of code may be present in a function for easy re-use of that code.
If you want to define a function, type the function keyword followed by the function name, then include your code inside curly braces.

For example,

function Add

{
 $args[0] + $args[1]
}

Image result for powershell define function

If you want to display a function’s definition, then more than one method can be of use.

Related Questions