O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Working with Functions

The concept of a function in many programming languages, PowerShell included, has much in common with the mathematics concept of a function. A function is an operation that accepts a set of parameters and returns new values. Mathematics requires that a function depend on its parameters only; that is, it should always return the same value given the same parameters. However, shell users do not have to comply with that restriction. A function in PowerShell is just another name for a subroutine or a piece of code that can accept parameters, execute actions, and return values.

Subroutines are possibly the most important invention in computer science and the field of programming. Invented back in 1948 by David Wheeler, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required