Chapter 15. PSDrives and PSProviders
This chapter covers
- Understanding PSProviders
- Working with PSDrives
- Using transactional processing
When you add a module or a PSSnapin to PowerShell, you usually take this step because of the commands contained within those extensions. But extensions can also add something called a PSProvider to the shell, and those providers can be useful in ways many administrators haven’t realized are possible.
PSProviders, or providers for short, don’t immediately seem like a good idea for administration, but they are. To better understand what providers are, and what advantages they offer, you have to understand the other way of managing things in PowerShell: using commands.
Think about what developers at Microsoft have to do when they’re designing a set of commands. Take Active Directory as an example: First, they have to think of the nouns they’ll create. In other words, what kinds of things exist in Active Directory? These can include users, computers, contacts, printers, organizational units, and so forth. Once they have a list of the available nouns, they think of what they can do with those things, and that’s their list of verbs: Create new ones, delete them, modify them, move them, and so on. Combine the two lists and you have the list of commands that you’ll need to create: New-ADUser, Set-ADUser, Remove-ADUser, and on and on.