Skip to Main Content
Windows Server 2008: The Definitive Guide
book

Windows Server 2008: The Definitive Guide

by Jonathan Hassell
March 2008
Beginner to intermediate content levelBeginner to intermediate
494 pages
13h 4m
English
O'Reilly Media, Inc.
Content preview from Windows Server 2008: The Definitive Guide

Using Data Stores and PowerShell Providers

Today's modern computing world makes use of a vast variety of data stores, including the file store, the certificate store, the Registry, etc. With previous tools, each of these data stores are accessed using different and incompatible tools, making it hard for the admin to learn, use, and master. PowerShell take a different approach through the use of providers and standard cmdlets.

A PowerShell provider is a software component that sits between the actual data store and the standard cmdlets. The standard cmdlets call into the provider to return the relevant data and present it in a admin-friendly way. To aid in conversion, PowerShell provides aliases for these standard cmdlets. The provider architecture is shown at http://msdn2.microsoft.com/en-us/library/ms714658.d2eb7674-3a27-4baf-91b7-b8eaf1e8ab2c(en-us,VS.85).gif.

To illustrate this, let's look at the two data stores, the filesystem and the Registry:

PSH [D:\foo]:dir

    Directory: Microsoft.PowerShell.Core\FileSystem::D:\foo

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----        14/10/2007     12:04            bar

PSH [D:\foo]: cd bar
PSH [D:\foo\bar]: ls

    Directory: Microsoft.PowerShell.Core\FileSystem::D:\foo\bar

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        14/10/2007     12:04          8 foobar.txt

PSH [D:\foo\bar]: cd hklm:
PSH [HKLM:\]: ls Hive: Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE SKC VC Name Property --- -- ---- -------- 4 0 HARDWARE {} 87 0 SOFTWARE {} 8 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Complete Guide to Windows Server 2008

The Complete Guide to Windows Server 2008

John Savill

Publisher Resources

ISBN: 9780596514112Errata Page