PowerShell Fundamentals
PowerShell is a command-line shell, scripting language, and automation framework built on .NET. It sends structured objects between commands, which lets you inspect and manage systems without reducing every result to text.
itWindows and Microsoft infrastructure | OpenSkills.info
Intro
PowerShell Fundamentals
PowerShell is a command-line shell, scripting language, and automation framework built on .NET. Its defining feature is an object pipeline. Commands emit structured objects with properties and methods, and later commands receive those objects directly. A traditional shell often connects programs with streams of text. PowerShell can still handle text and native programs, but its own commands exchange typed data.
This design serves interactive administration and repeatable automation. You can inspect one process at a prompt, filter hundreds of services through a pipeline, or save the same logic in a script. Modules extend the command set for operating systems, cloud services, applications, and APIs.
The runtime and command path
A PowerShell session runs inside a host such as a terminal, Visual Studio Code, or Azure Cloud Shell. The host handles the user interface. The PowerShell engine parses input, resolves command names, binds arguments to parameters, invokes commands, and writes results to output streams.
Most PowerShell commands are cmdlets. Cmdlet names conventionally use an approved verb and a singular noun, such as Get-Process or Stop-Service. The verb describes the action. The noun identifies the resource. Get-Command discovers commands, while Get-Help explains syntax, parameters, inputs, outputs, and examples.
A command can come from several sources:
- A cmdlet implemented in a compiled module
- A PowerShell function loaded in the session
- A script stored in a
.ps1file - An alias that resolves to another command
- A native executable provided by the operating system
PowerShell resolves these command types by precedence. Use the full command name in scripts when an alias could hide which command runs. Get-Command <name> -All reveals every matching command and its type.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://learn.microsoft.com/en-us/powershell/scripting/overview
Supports
- PowerShell combines a command-line shell, scripting language, and automation framework
- PowerShell is cross-platform and passes .NET objects through its pipeline
- PowerShell works with structured data, APIs, and object models
- https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/01-getting-started
Supports
- Command discovery, verb-noun naming, aliases, hosts, and editor choices
- Visual Studio Code with the PowerShell extension supports current PowerShell and Windows PowerShell
- https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/02-help-system
Supports
- Get-Help syntax, parameter, example, and update behavior
- https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/03-discovering-objects
Supports
- Get-Member exposes object types, properties, and methods
- Select-Object projects object properties
- https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/04-pipelines
Supports
- Cmdlets pass objects through pipelines
- Filtering, sorting, selection, and formatting behavior
- Formatting output should remain at the display boundary
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_command_syntax
Supports
- PowerShell command diagrams, parameters, switches, and argument notation
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parameter_binding
Supports
- Explicit and pipeline parameter binding
- Pipeline binding by value and by property name
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_variables
Supports
- Variables store PowerShell values and use dollar-sign notation
- Type constraints and variable scope behavior
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules
Supports
- Expandable and verbatim string behavior
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comparison_operators
Supports
- Equality, ordering, wildcard, regular-expression, and case-sensitive comparison operators
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_providers
Supports
- Providers expose data stores through drives, paths, and item cmdlets
- Provider-specific dynamic parameters and built-in provider examples
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scripts
Supports
- Script files, parameters, invocation, and scope
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scopes
Supports
- Visibility and lifetime rules for variables, functions, and aliases
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles
Supports
- Profiles are host and user scoped startup scripts
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_modules
Supports
- Module discovery, import, automatic loading, and exported commands
- https://learn.microsoft.com/en-us/powershell/gallery/overview
Supports
- PowerShell Gallery distributes community and Microsoft modules and scripts
- PSResourceGet discovers and installs PowerShell packages
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_error_handling
Supports
- Terminating and non-terminating error behavior
- ErrorAction Stop promotes a non-terminating error for handling
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_try_catch_finally
Supports
- Try, catch, and finally control flow
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_output_streams
Supports
- PowerShell success, error, warning, verbose, debug, information, and progress streams
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables
Supports
- Error, question-mark, last-exit-code, and script-root automatic variables
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies
Supports
- Execution policy controls script-loading conditions on Windows
- Execution policy is a safety feature rather than a security boundary
- https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-shouldprocess
Supports
- WhatIf and Confirm behavior depends on command support for ShouldProcess
- https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell
Supports
- Current PowerShell and Windows PowerShell use different executables and .NET runtimes
- PowerShell supports Windows, Linux, and macOS while Windows PowerShell is Windows-only
- Compatibility considerations for Windows PowerShell modules
- https://learn.microsoft.com/en-us/training/paths/powershell/
Supports
- Ordered Microsoft Learn material for PowerShell commands, pipelines, and scripting
- https://github.com/sindresorhus/awesome
Supports
- The Awesome index identifies a PowerShell ecosystem list
- https://github.com/janikvonrotz/awesome-powershell
Supports
- Discovery of Pester, PSScriptAnalyzer, PSReadLine, posh-git, ImportExcel, PlatyPS, and Oh My Posh
- https://pester.dev/docs/quick-start/
Supports
- Pester tests and mocks PowerShell commands and scripts
- Pester produces test and code-coverage artifacts
- https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/overview
Supports
- PSScriptAnalyzer performs configurable static analysis of PowerShell scripts and modules
- https://learn.microsoft.com/en-us/powershell/scripting/learn/shell/using-keyhandlers
Supports
- PSReadLine maps interactive editing functions to configurable key handlers
- https://github.com/dahlbyk/posh-git
Supports
- posh-git adds Git status summaries and completion to PowerShell prompts
- https://github.com/dfinke/ImportExcel
Supports
- ImportExcel reads and writes spreadsheet data, tables, charts, and pivot tables without Excel
- https://github.com/PowerShell/platyPS
Supports
- PlatyPS converts Markdown-authored command help into the format used by Get-Help
- https://ohmyposh.dev/docs/
Supports
- Oh My Posh configures contextual prompt segments across supported shells
- https://learn.microsoft.com/en-us/azure/cloud-shell/overview
Supports
- Azure Cloud Shell provides a browser-accessible authenticated PowerShell environment for Azure
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_windows_powershell_ise?view=powershell-5.1
Supports
- Windows PowerShell ISE is a Windows PowerShell graphical host for editing, running, and debugging scripts
- ISE does not support PowerShell 6 or later and is no longer in active feature development
- https://learn.microsoft.com/en-us/windows/terminal/
Supports
- Windows Terminal hosts command-line profiles including PowerShell and Windows PowerShell
- https://www.sapien.com/software/powershell_studio
Supports
- PowerShell Studio provides a commercial editor, debugger, and packaging environment for PowerShell
- https://learn.microsoft.com/en-us/powershell/scripting/developer/monad-manifesto
Supports
- The 2002 Monad Manifesto established the design vision that became PowerShell
- https://devblogs.microsoft.com/powershell/windows-powershell-1-0-released/
Supports
- Windows PowerShell 1.0 was released in November 2006
- https://devblogs.microsoft.com/powershell/the-community-technology-preview-ctp-of-windows-powershell-2-0/
Supports
- The first PowerShell 2.0 preview introduced remoting, jobs, script cmdlets, and hosting APIs in November 2007
- https://devblogs.microsoft.com/powershell/windows-powershell-2-0-rtm/
Supports
- PowerShell 2.0 reached release to manufacturing with Windows 7 and Windows Server 2008 R2 in July 2009
- https://devblogs.microsoft.com/scripting/powershell-3-0-is-now-available-for-download/
Supports
- PowerShell 3.0 became available through Windows Management Framework 3.0 in September 2012
- https://devblogs.microsoft.com/powershell/windows-powershell-is-now-powershell-an-open-source-project-with-linux-support-how-did-we-do-it/
Supports
- PowerShell became open source and added Linux and macOS support in August 2016
- https://devblogs.microsoft.com/powershell/powershell-core-6-0-generally-available-ga-and-supported/
Supports
- PowerShell Core 6.0 became a supported cross-platform edition in January 2018
- https://devblogs.microsoft.com/powershell/announcing-powershell-7-0/
Supports
- PowerShell 7.0 became generally available in March 2020
- PowerShell 7 improved compatibility while retaining cross-platform operation
