Core Skills

Chapter 7 of 18

Chapter 7: One Way to Explore Every Store

This chapter gives you one of the nicest ideas in PowerShell, and it is simpler than it sounds. A provider is a helper that makes a different kind of store, like the registry or a list of environment variables, look and feel like folders and files. Once a store looks like a drive, you can move around in it and list what is inside it with commands you already know. That means less new learning and more confidence, because the same moves work in more places. By the end of this chapter, you will be able to list your drives, move into a new drive, list its contents, and find your way back again.

1 lesson 3 learning objectives 3 related commands

Topics at a glance: Providers and drives.

Where this chapter fits

This chapter comes after Chapter 6: Toolboxes You Can Load When You Need Them in the journey, so ideas from that chapter will feel familiar here.

After this chapter comes Chapter 8: Build Your Own Commands.

Learning objectives

By the end of this chapter, you will be able to:

  • Explain what a provider and a drive are
  • Navigate between drives with Set-Location
  • List items in a drive with Get-ChildItem

Lessons in this chapter

Work through the lessons in order. Each lesson page has explanations, examples, common mistakes, and a knowledge check.

  1. Lesson 1: Providers and drives

    A provider is an adapter that makes a data store look like a drive. Once you see a store as a drive, the file commands you already know start working on it.

    3 things to learn in this lesson

Related command references

These command pages are linked to lessons in this chapter. Each command page has its syntax, parameters, and examples.

  • Get-ChildItem

    Lists items in a location, such as files in a folder or keys in a provider drive.

    From the lesson: Providers and drives

  • Set-Location

    Moves the current location to a new drive or folder.

    From the lesson: Providers and drives

  • Get-PSDrive

    Lists PowerShell drives, with their providers and roots.

    From the lesson: Providers and drives

Tip: read the lesson first, then use the command page as a quick reference.