Level 1
0 / 100 XP

Powershell Command Syntax

In this lab, you will learn how PowerShell cmdlets follow the Verb-Noun naming convention and how to interpret command syntax.

Session duration: 30 minutes· Typical launch: ~3 min

Difficulty

Beginner

Lab level

Lab VMs

1

1 Windows

XP Reward

150 XP

On completion

Virtual machines

Lab VMs

Windows

SADC01

Windows

Username / Password

user / password123

Connection type

In-browser RDP / RDP

CPU / RAM

Lab instructions

Follow the steps below to complete the lab.

In this lab, you will learn how PowerShell cmdlets follow the Verb-Noun naming convention and how to interpret command syntax.

  1. Login with username ladmin and password password123
  2. Open Windows PowerShell as an Administrator.
  3. Display the syntax for the Get-Service cmdlet:
Powershell
Get-Help Get-Service
  1. Display examples for the Get-Service cmdlet:
Powershell
Get-Help Get-Service -Examples
  1. Display all commands that use the Get verb:
Powershell
Get-Command -Verb Get
  1. Display all commands that use the Service noun:
Powershell
Get-Command -Noun Service
  1. Find all commands whose noun contains the word Process:
Powershell
Get-Command *Process*
  1. Find all commands whose noun contains the word Service:
Powershell
Get-Command *Service*
  1. Find all commands that begin with the letters Get-:
Powershell
Get-Command Get-*
  1. Find all commands that end with Item:
Powershell
Get-Command *Item
  1. Display all services:
Powershell
Get-Service
  1. Display all services whose name begins with Win:
Powershell
Get-Service Win*
  1. Display all services whose display name contains Windows:
Powershell
Get-Service *Windows*
  1. Display the Windows Update service:
Powershell
Get-Service -Name wuauserv
  1. Display all running services:
Powershell
Get-Service | Where-Object Status -eq Running
  1. Display the first five running processes:
Powershell
Get-Process | Select-Object -First 5
  1. Display all processes whose name begins with sv:
Powershell
Get-Process sv*
  1. Display all commands available in the Microsoft.PowerShell.Management module:
Powershell
Get-Command -Module Microsoft.PowerShell.Management
  1. Display detailed information about the Get-Service cmdlet:
Powershell
Get-Command Get-Service | Format-List *
  1. Execute the following command to export your executed commands:
Powershell
Get-History | Export-Clixml "$env:USERPROFILE\Downloads\PowerShellLab.txt"
  1. Click Check step to proceed.