![Lead Image © Philip Kinsey, 123RF.com Lead Image © Philip Kinsey, 123RF.com](/var/ezflow_site/storage/images/archive/2017/39/working-with-objects-in-powershell/philip_kinsey_123rf-multi-tool.png/137747-1-eng-US/Philip_Kinsey_123RF-Multi-Tool.png_medium.png)
Lead Image © Philip Kinsey, 123RF.com
Working with objects in PowerShell
Useful Tool
If you want to professionally manage Windows systems, and above all servers, it's hard to avoid using PowerShell. Many admins, however, find it somewhat difficult to cope with the object-oriented approaches of the scripting language. Our workshop provides assistance and illuminates the fundamental concepts.
Of course, admins use scripting languages to handle administrative and support tasks, and many system administrators will have had no alternative but to delve the depths of the SQL language. Basically, most administrators want to do their jobs rather than develop programs, which explains why many experienced Windows admins have a certain aversion to working with PowerShell. This is particularly unfortunate, because this language can significantly facilitate the work, specifically because of its structure and object-oriented approach (see the "Object-Oriented Structure in PowerShell" box for more information). The motivation behind this article is thus to show how the developers implemented this concept and how the scripting language uses these objects.
Object-Oriented Structure in PowerShell
The foundation of PowerShell comprises special .NET classes that make it possible to use the entire .NET library from within the PowerShell environment. The cmdlets available directly in the PowerShell environment run perform specified actions, such as enumerating the files in a directory or managing a system service.
The cmdlets for PowerShell objects typically return objects, although there are some exceptions. The cmdlets perform an action of this type by creating an object or a group of objects based on the specialized PowerShell classes. They then provide the functions available, with the help of which, for example, the information can be routed through the pipeline and used by other commands.
Often the problem for
Buy this article as PDF
(incl. VAT)