SEC505
  • Welcome to "Securing Windows with PowerShell: A Deep Dive into SEC505"
    • Sec 505.1
      • Intro to Ps
      • Tips for Executing Commands
      • Getting Help in PowerShell
      • Aliases in PowerShell
      • Objects, Properties, and Methods
      • Get-Member (Alias: gm)
      • Drives and Environment Variables
      • Your Profile Script(s)
      • Functions, Cmdlets, and Modules
      • The PowerShell Gallery
      • Exporting, Importing, an d Converting Pages Reusable content Files Object Data
        • Select-Object (Alias: Select)
          • Arrays Are like In-Memory Database Tables
      • Search Event Logs
      • Hashtables and Splatting
      • Flow Control (All in one)
      • Functions
Powered by GitBook
On this page
  • Let's start
  • Step 1: Starting with Get-Help Basics
  • Step 2: Searching with Wildcards
  • Step 3: Diving into Cmdlet Details
  • Step 4: Using -ShowWindow for Graphical Help
  • Step 5: Exploring about* Topics
  • Step 6: Controlling Help Output
  • Step 7: Updating Help Files
  • Step 8: Practical Workflow Example
  1. Welcome to "Securing Windows with PowerShell: A Deep Dive into SEC505"
  2. Sec 505.1

Getting Help in PowerShell

Let's start

PowerShell can feel like a maze, but the Get-Help cmdlet is your map. This guide walks you through using PowerShell’s help system, step by step, so you can find commands, understand syntax, and solve problems fast. Each section breaks down a technique with purpose, details, and why it’s worth your time. Let’s dive in!


Step 1: Starting with Get-Help Basics

Purpose

Get a quick intro to PowerShell’s help system and see how Get-Help explains itself.

Technical Details

  • Command: Get-Help

  • Output: Brief overview of Get-Help, including synopsis and usage.

  • Source: Local help files in $pshome\en-us\ (e.g., Get-Help.help.txt).

Why It Matters

  • Accessibility: Built-in help, no internet needed.

  • Foundation: Teaches you how to explore any command.

  • Speed: Instant answers from the console.

Try It: Run Get-Help—see the basics unfold.


Step 2: Searching with Wildcards

Purpose

Find commands when you only know part of their name.

Technical Details

  • Commands:

    • Get-Help set-*: Lists cmdlets like Set-Item, Set-Location.

    • Get-Help *loc*: Finds Get-Location, Set-Location, etc.

  • Wildcard (*): Matches any characters in a name.

Why It Matters

  • Efficiency: No need to guess exact names.

  • Discovery: Uncovers related commands fast.

  • Flexibility: Multiple wildcards work too.

Try It: Run Get-Help set-* or Get-Help *proc*—explore what pops up.


Step 3: Diving into Cmdlet Details

Purpose

Get full details on a specific command, like syntax and examples.

Technical Details

  • Commands:

    • Get-Help Get-Process: Summary of Get-Process.

    • Get-Help Get-Process -Full: Complete help with parameters (e.g., -Name, -Id) and examples.

  • Switch: -Full expands output.

Why It Matters

  • Precision: Know every option available.

  • Examples: Real code to copy or adapt.

  • Mastery: Builds confidence for complex tasks.

Try It: Run Get-Help Get-Process -Full—check out the depth.


Step 4: Using -ShowWindow for Graphical Help

Purpose

View help in a searchable pop-up window.

Technical Details

  • Command: Get-Help Get-Process -ShowWindow

  • Output: Graphical window with full help text and a search box.

Why It Matters

  • Readability: Easier than scrolling console text.

  • Search: Find keywords without retyping.

  • Workflow: Keep it open while you work.

Try It: Run Get-Help Get-Process -ShowWindow—search “example” in the window.


Step 5: Exploring about* Topics

Purpose

Learn PowerShell concepts through detailed topical essays.

Technical Details

  • Commands:

    • Get-Help about*: Lists topics like about_Aliases, about_Functions.

    • Get-Help about_Functions: Explains functions in depth.

  • Source: Plaintext files in $pshome\en-us\.

Why It Matters

  • Context: Understand the “why” behind commands.

  • Depth: Covers loops, variables, and more.

  • Reference: Great for side-by-side reading.

Try It: Run Get-Help about*, then Get-Help about_Aliases.


Step 6: Controlling Help Output

Purpose

Manage long help text to keep it readable.

Technical Details

  • Options:

    • Get-Help about_Alias | more: One page at a time (Space to advance).

    • help about_Alias or man about_Alias: Aliases for Get-Help | more.

    • Buffer Fix: Right-click title bar > Properties > Layout > Set Screen Buffer Height to 1000 > OK (adds scrollbar).

Why It Matters

  • Clarity: No text overload.

  • Ease: help/man save keystrokes.

  • Control: Scroll back with a bigger buffer.

Try It: Run help about_Alias, then tweak your buffer.


Step 7: Updating Help Files

Purpose

Keep help current with Microsoft’s latest docs.

Technical Details

  • Command: Update-Help -Verbose

  • Action: Downloads updates, shows progress with -Verbose.

  • Offline: Use Save-Help (see Get-Help Update-Help -Full).

Why It Matters

  • Accuracy: Stay up to date with PowerShell changes.

  • Flexibility: Works online or offline.

  • Knowledge: Learn how help is managed.

Try It: Run Update-Help -Verbose if online—watch it update.


Step 8: Practical Workflow Example

Purpose

Tie it all together to solve a real task.

Technical Details

  • Task: Stop a process.

  • Steps:

    1. Get-Help *process*: Find Stop-Process.

    2. Get-Help Stop-Process -Full: Check -Name parameter.

    3. Get-Help Stop-Process -ShowWindow: Reference it.

    4. Stop-Process -Name notepad: Done.

Why It Matters

  • Application: Turns theory into action.

  • Efficiency: Solves problems fast.

  • Skill: Reinforces all steps above.


PreviousTips for Executing CommandsNextAliases in PowerShell

Last updated 2 months ago

Page cover image