O'Reilly logo

Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook by Yaroslav Pentsarskyy

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

Creating a custom PowerShell command (CmdLet)

In this chapter, previous recipes have tackled accessing custom functions in other SharePoint libraries, and using those functions to perform various operations in our script. It's now time for us to see how we can create our own custom function executing some custom logic. Once the command has been created, it will be accessible from within PowerShell for users to call.

This is particularly handy when you're creating a collection of functions which perform frequent administrative tasks on your server.

Another example where you might want to create your own CmdLet is when you're planning to package those as custom offering for your customers to download and use on their environments.

Getting ready

To ...

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