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

How it works…

On Linux, PowerShell support is limited (at the time of writing this book). Discussion on the issues pertaining to providers on Linux indicates that further development is highly likely, especially regarding cross-provider support.

A provider is a program that logically represents non-filesystem drives as though they are drives. For instance, on Windows, the Registry is a database of configuration information. In PowerShell 6 on Windows and on Windows PowerShell, the Registry is a provider; this way, administrators can use PowerShell to navigate and manipulate Registry keys in the same way that we work with files. This capability is available on Linux as well, however, there aren't as many providers as there are on Windows.

If you are interested in programming, providers in PowerShell are a great example of the concept of overloading in object-oriented programming.

The Name column gives the names of the providers. Each provider may have one or more drives. For instance, the FileSystem provider in Windows shows all of the partitions (C:, D:, E:, and so on) present on the computer. A Set-Location operation is performed on these drives within the providers, and not the providers themselves. To indicate to PowerShell that you are connecting to a drive and not a subdirectory, the name of the drive must be followed by a colon.