Chapter 27. Custom type extensions

This chapter covers

  • Using PowerShell’s Extensible Type System
  • Creating custom type extensions
  • Importing custom type extensions
  • Creating custom type extensions dynamically

Windows PowerShell includes an Extensible Type System (ETS). A type, in Power-Shell’s world, is a data structure that describes what a type of data looks like, as well as what capabilities that type of data has. For example, there’s a type that represents a Windows service. The type says that a service has a name, a description, a status, and other properties. The type also says that a service has methods enabling you to stop the service, start it, pause it, resume it, and so on.

Types are generally born within the .NET Framework that ...

Get PowerShell in Depth 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.