10
Files, Folders, and the Registry
In PowerShell, providers are the most obvious subsystem for working with the filesystem and registry. A provider presents access to a data store as a hierarchy consisting of container or leaf objects. Using the filesystem as an example, a folder or directory is a container; a file is a leaf. Conversely, the Registry provider only supports containers or keys.
PowerShell offers common commands to interact with a provider hierarchy. The commands available to a provider differ depending on the features the provider supports. For example, supporting navigation makes Get-ChildItem
, Get-Item
, New-Item
, and so on available.
PowerShell can also make use of .NET types. The System.IO
namespace contains classes for working ...
Get Mastering PowerShell Scripting - Fifth Edition 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.