PowerShell Lesson 1: Basics β€” Cmdlets, Discovery and Execution Policies

PowerShell Lesson 1: Basics β€” Cmdlets, Discovery and Execution Policies featured illustration

πŸ“Ž This article includes 2 downloadable practice files ↓

⏱ 3 min readUpdated 11 November 2026

πŸ“˜ PowerShell Beginner Course Β· Lesson 1 of 6

In this article
  1. Understanding Cmdlets and the Verb-Noun Syntax
  2. Basic Level: Command Discovery and Help System
  3. Intermediate Level: Execution Policies and Script Security
  4. Safe Policy Configuration
  5. Expert Level: PowerShell 5.1 vs PowerShell 7 (Core)
  6. Practice Exercise
  7. Continue learning

PowerShell is a task automation and configuration management framework developed by Microsoft, consisting of a command-line shell and a deeply integrated scripting language. Unlike traditional shells that output plain text (such as Bash or CMD), PowerShell passes structured .NET objects through its pipeline. This fundamental difference means you never need to rely on brittle text parsing tools like awk or sed to extract columns or properties.

Advertisement

Understanding Cmdlets and the Verb-Noun Syntax

Every native PowerShell command is called a cmdlet (pronounced command-let) and follows an intuitive Verb-Noun naming convention. The verb describes the action (e.g., Get, Set, New, Remove, Start, Stop), while the noun specifies the resource being operated upon (e.g., Process, Service, Item, Date, Content).

# Core Verb-Noun examples
Get-Date -Format "yyyy-MM-dd HH:mm:ss"    # Retrieve current timestamp
Get-Service -Name "wuauserv"              # Check Windows Update service state
Get-Process | Where-Object WorkingSet -gt 100MB # Active processes using >100MB RAM

Basic Level: Command Discovery and Help System

You never have to memorize hundreds of command names in PowerShell because the engine provides three built-in discovery cmdlets:

  • Get-Command: Discovers cmdlets, functions, and aliases installed on your system.
  • Get-Help: Displays detailed documentation, parameter explanations, and real-world syntax.
  • Get-Member: Inspects any object to reveal all its available properties and methods.
# 1. Discover all commands related to network IP configuration
Get-Command -Noun *IPConfiguration*

# 2. View official examples with copy-pasteable syntax
Get-Help Get-ChildItem -Examples

# 3. View the complete manual with parameter details
Get-Help Copy-Item -Detailed

Intermediate Level: Execution Policies and Script Security

When you attempt to run a saved .ps1 script on a fresh Windows machine, Windows blocks execution by default under the Restricted execution policy to protect users from malicious scripts downloaded from the web.

Advertisement

Safe Policy Configuration

To safely permit your own scripts while protecting system files, set the execution policy for your current user account to RemoteSigned:

# Check current effective policy across all scopes
Get-ExecutionPolicy -List

# Safely permit local scripts for your user account
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

Under RemoteSigned:

Advertisement
  • Scripts written locally on your computer run without restriction.
  • Scripts downloaded from the internet (tagged with a browser Zone.Identifier) require a trusted digital signature, or must be unblocked using Unblock-File -Path .myscript.ps1.

Expert Level: PowerShell 5.1 vs PowerShell 7 (Core)

Modern enterprise environments frequently contain two parallel versions of PowerShell:

Feature Windows PowerShell 5.1 PowerShell 7.x (Core)
Runtime Engine .NET Framework 4.8 .NET 8 / 9 (Modern)
Platform Support Windows only (built-in) Windows, macOS, Linux
Execution Path powershell.exe pwsh.exe
Parallel Processing Workflow / Runspaces Native ForEach-Object -Parallel
Ternary Operator Not supported ? :
# High-speed parallel processing in PowerShell 7+
1..20 | ForEach-Object -Parallel {
    Test-Connection -TargetName "192.168.1." -Count 1 -Quiet
} -ThrottleLimit 10

Practice Exercise

  1. Open PowerShell and run Get-Command -Verb Test to see all diagnostics cmdlets.
  2. Use Get-Date | Get-Member to view all properties of the DateTime object. Notice that DayOfWeek and DayOfYear are accessible without string manipulation.

πŸ“Ž Practice files for this article

⬇ Download all 2 files (ZIP Β· 459 B)

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong

Leave a Comment