PowerShell Core for Linux Administrators Cookbook
上QQ阅读APP看书,第一时间看更新

Dissecting a .NET Core object

This is a tangential recipe, in case you are interested in seeing how PowerShell has been implemented.

.NET Core works on a cross-platform standard Common Language Infrastructure. Therefore, it has been possible to encapsulate the internal workings of Linux using .NET Core. As we will see in future chapters, PowerShell is object-oriented, just like .NET Core. For this demonstration, we will pick a simple system class called System.IO.DirectoryInfo to show information about a certain directory. We will also compare the output of the .NET Core object to the output of a PowerShell cmdlet, which also shows information about a certain directory.

You do not have to remember the names of the .NET Core classes or methods, or their syntax to work with PowerShell; that is the whole point of the existence of PowerShell. However, if you need information on the .NET libraries and the classes, extensive help documentation is available online ().