How it works...
.NET is an Object-Oriented Programming language, and like Java and others is a high language. Unlike other programming languages such as C, Assembler, and others, developers do not need to concern themselves with memory management and machine-specific things.
Through a wealth of different classes for all kinds of things such as IO, networking, text processing, and much, much more, C# and .NET are a popular choice for many developers. But it should become a popular choice for administrators as well: PowerShell Core is based on .NET Core and can access the full range of .NET Standard functionalities, giving you access to many powerful and useful classes.
In Steps 1 through 4, you examined a C# code snippet that was imported using the Add-Member cmdlet. In PowerShell, the New-Object cmdlet is used to create an instance of a class. In some instances, you have to call this cmdlet yourself to create your objects, as you saw in Step 5. More often, though, a cmdlet will create instances of classes for you when executed.
As we saw in this recipe, .NET classes are organized into namespaces.When we work with .NET, we usually use classes that are defined somewhere in the System namespace and its child namespaces, for example, System.IO or System.Management.Automation.
Every class will have a combination of properties and methods, among other types, like events. Those class members can be publicly accessible or only accessible to the class itself.
In the following recipes, we will gradually discover more and more aspects of the .NET Framework and its use in PowerShell.