PowerShell Basics

Chapter 2 of 18

Chapter 2: Your First PowerShell Commands

Welcome to PowerShell. In this chapter you will learn what PowerShell is, which version you are running, and where you should type your commands. You will also learn how commands are named, and how to get help without guessing. These are small skills, but they make everything after this chapter much easier. By the end, you will be able to open the right tool, read a command with confidence, and find the answer when you get stuck.

5 lessons 3 learning objectives 7 related commands

Topics at a glance: What is PowerShell, PowerShell versions, Work environments: ISE, console, and VS Code, Syntax: Verb-Noun and parameters, Getting help: Get-Help, About, and IntelliSense.

Where this chapter fits

This chapter comes after Chapter 1: How Windows Works Underneath in the journey, so ideas from that chapter will feel familiar here.

After this chapter comes Chapter 3: Think in Objects, Not Text.

Learning objectives

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

  • Explain what PowerShell is and why it uses objects
  • Choose a work environment: console, ISE, or VS Code
  • Read a Verb-Noun command and use Get-Help with confidence

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: What is PowerShell

    PowerShell is a command line shell and a scripting language. It is built on .NET, and it works with objects instead of plain text.

    3 things to learn in this lesson

  2. Lesson 2: PowerShell versions

    There are two families: Windows PowerShell, which ships with Windows, and PowerShell, the cross platform edition. Knowing which one you run avoids surprises.

    3 things to learn in this lesson

  3. Lesson 3: Work environments: ISE, console, and VS Code

    You can run PowerShell in a console, in the older ISE editor, or in Visual Studio Code. All three run the same language, but they suit different jobs.

    3 things to learn in this lesson

  4. Lesson 4: Syntax: Verb-Noun and parameters

    Every PowerShell command follows the same shape: a verb, a noun, and optional parameters. Once you see the pattern, new commands become easy to guess.

    3 things to learn in this lesson

  5. Lesson 5: Getting help: Get-Help, About, and IntelliSense

    PowerShell documents itself. Get-Help explains a command, About topics explain concepts, and Ctrl plus Space completes names for you.

    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-Help

    Shows help for a command, including syntax, parameters, and examples.

    From the lesson: Getting help: Get-Help, About, and IntelliSense

  • Update-Help

    Downloads the newest help files for installed modules.

    From the lesson: Getting help: Get-Help, About, and IntelliSense

  • Get-Command

    Lists commands available in the session, optionally filtered by noun or verb.

    From the lesson: Syntax: Verb-Noun and parameters

  • Get-Verb

    Lists approved verbs used in cmdlet names.

    From the lesson: Syntax: Verb-Noun and parameters

  • Get-Host

    Shows facts about the current PowerShell host program.

    From the lesson: What is PowerShell

  • Get-Process

    Lists running processes as objects, with properties such as Name, Id, and CPU.

    From the lesson: What is PowerShell

  • Get-Alias

    Lists aliases, which are short names for commands.

    From the lesson: Syntax: Verb-Noun and parameters

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