Advanced PowerShell

This chapter has given an overview of PowerShell and examined a number of key features. But there are so many more aspects of PowerShell; you could fill books with the information (and indeed several writers have).

Some of the more advanced tasks you can accomplish with PowerShell include:

Update formatting type information

If you are designing your own cmdlets, providers, or applications, you may want to define your new object types, extend existing object types, or modify how an object is displayed by the hosting application. You may also want to change PowerShell's default formatting to suit your own needs. See http://msdn2.microsoft.com/en-us/library/ms714665.aspx for more details on how to create new display XML files and incorporate them into your environment.

Host PowerShell in your own application

The Exchange 2008 management console is an example of this. The EMC natively hosts PowerShell and uses PowerShell to carry out the tasks specified in the GUI. For more information on hosting PowerShell in your own application, see http://msdn2.microsoft.com/en-us/library/ms714661.aspx.

Add or amend cmdlet help information

You can write help information for your own cmdlets or extend the help information for existing cmdlets. See http://msdn2.microsoft.com/en-us/library/aa965353.aspx for more information.

Write cmdlets in script

You can use PowerShell to write pipeline-aware functions, in effect cmdlets using scripts. For a good explanation of how to achieve this, see ...

Get Windows Server 2008: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.