Skip to Main Content
Learn PowerShell Scripting in a Month of Lunches
book

Learn PowerShell Scripting in a Month of Lunches

by Jeffery Hicks, Don Jones
December 2017
Beginner content levelBeginner
352 pages
10h 31m
English
Manning Publications
Content preview from Learn PowerShell Scripting in a Month of Lunches

Chapter 11. Going advanced with your function

In this chapter, we’ll focus entirely on the Param() block of the example function and discuss some of the cool things you can do with it.

11.1. About CmdletBinding and common parameters

Back when PowerShell v2 was being developed, Microsoft toyed with the idea of having a cmdlet{} construct that was essentially a superset of function{}. The idea was that these “script cmdlets” would exhibit all the behaviors of a “real” cmdlet (for example, one written in .NET and compiled into an assembly). By the time v2 released, these had become advanced functions, and they’re differentiated primarily by the [CmdletBinding()] attribute. To illustrate the first major difference, let’s start with a basic function: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Windows PowerShell in a Month of Lunches, Third Edition

Learn Windows PowerShell in a Month of Lunches, Third Edition

Don Jones

Publisher Resources

ISBN: 9781617295096Publisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link