Use this to start with PowerShell automation.
PowerShell Fundamentals
PowerShell fundamentals: cmdlets output objects, the pipeline passes them on, Get-Help and Get-Member explain them, and PowerShell 7 runs cross-platform beside Windows PowerShell 5.1.
1. Fundamentals: cmdlets (Verb-Noun), objects, pipeline, providers.
2. Windows PowerShell 5.1 vs PowerShell 7.
3. Get-Help, Get-Command, Get-Member.
4. Execution policy is not a security boundary.
5. Use approved verbs.
command → objects → pipeline
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Verify the environment with $PSVersionTable, Get-Location, Get-Module, and Get-Command. For a command under investigation, inspect syntax and source before running it, then inspect returned object type with Get-Member. Re-run the same operation in the non-interactive or remote host used by automation because an interactive console can hide profile and module-loading assumptions.
Step 2 Common mistakes Narrow the fault
- Windows PowerShell 5.1 vs PowerShell 7 differences ignored.
Step 3 Where it fails Narrow the fault
Fundamental syntax errors, command-not-found failures, binding failures, provider-path errors and target-operation failures occur at different layers. A command that resolves locally may not resolve in another runspace, and a provider path can look filesystem-like while obeying different semantics. Do not treat formatting, host prompts or profile-loaded aliases as stable automation contracts.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Cmdlets output objects; the pipeline passes them on.
- PowerShell 7 runs on Windows, Linux and macOS.
- Windows PowerShell 5.1 is still common.
$PSVersionTable.PSVersion— versionGet-Help <cmdlet> -Full— documentationUpdate-Help— local help
ReferenceWhy it matters1 section · depth on demand
In depth
PowerShell fundamentals: commands are cmdlets named Verb-Noun, they output .NET objects, and the pipeline passes those objects to the next command. Help and discovery are built in.
| Task | Command |
|---|---|
| Find commands | Get-Command *Service* |
| Read help | Get-Help Get-Service -Examples |
| See object members | Pipe an object to Get-Member |
| Filter | Where-Object Status -eq 'Running' |
| Select properties | Select-Object Name, Status |
| Version | $PSVersionTable |
Approved verbs (Get, Set, New, Remove, Start, Stop) make commands predictable: if you know Get-Service, you can guess Stop-Service.
ReferenceImportant terms & boundaries1 section · depth on demand
PowerShell mechanics
PowerShell parses command text into language elements and commands, resolves aliases/functions/cmdlets/applications by command-precedence rules, binds arguments to parameters and emits objects across distinct output streams. Providers present stores such as FileSystem, Registry and Certificate through drives, while preference variables alter behavior within scope. The interactive host is only one consumer of the PowerShell engine; scripts, remoting endpoints and embedded runspaces can expose different session state.
ReferenceConfiguration & state1 section · depth on demand
Authoring and lifecycle
Reliable fundamentals start by making edition, version, current location, culture and required modules explicit. Avoid hidden dependencies on aliases or profiles in automation, prefer full command names, and use comment-based help or Get-Help to preserve discoverability. Keep persistent code/configuration in source control and regard session variables, imported modules and current drive as ephemeral execution context.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Review target identity, permissions and environment before mutation.
#Requires -Version 7.2
Set-StrictMode -Version LatestVerification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Microsoft Learn documentation reviewed for bounded PowerShell reference claims. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about?view=powershell-7.5 · confidence 94%Quick lookup tables
PowerShell Fundamentals · PowerShell operational reference
Topic-specific PowerShell runtime identity, persistence, verification, output and failure-boundary lookup.
| Boundary | PowerShell Fundamentals reference |
|---|---|
| Runtime identity | PowerShell edition/version + command/module source |
| Persistent intent | Script/module/config prerequisites under source control |
| Verification | Read-only discovery → execution evidence → independent target read-back |
| Output contract | Structured objects/streams before formatting |
| Failure boundary | Separate engine/binding from transport/API/native and target-state failures |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Distinguish the success stream from warning, verbose, debug, information and error streams. An object displayed as a table may contain more properties than the screen shows, so verify with property selection or Get-Member. $? describes the most recent operation in PowerShell terms, while $LASTEXITCODE is relevant to native programs; neither substitutes for target-state validation.