powershell_reserved_words_-_powershell_keywords

PowerShell Reserved Words - PowerShell Keywords

Return to PowerShell Glossary, Reserved Words, PowerShell, PowerShell Libraries, PowerShell Syntax, PowerShell Data Structures, PowerShell Algorithms, PowerShell Development Tools, PowerShell DevOps - PowerShell SRE - PowerShell CI/CD, Cloud Native PowerShell - PowerShell Microservices - Serverless PowerShell, PowerShell Security - PowerShell DevSecOps, Functional PowerShell, PowerShell Concurrency, PowerShell Data Science - PowerShell and Databases, PowerShell Machine Learning, Awesome PowerShell

Also called: PowerShell Language Keywords, PowerShell Reserved Keywords, PowerShell Keywords, PowerShell Reserved Identifiers, PowerShell Reserved words


Provide a list of Reserved Words in PowerShell. Answer in MediaWiki syntax with the URL of the official documentation for each language reference.

PowerShell, being a versatile scripting and automation platform, utilizes a set of reserved words or keywords that have special meanings within its environment. These keywords cannot be used as identifiers (like variable or function names) because they are part of the PowerShell syntax. Below is a list of common reserved words for PowerShell. The list includes a link to the official PowerShell documentation for further reference.

PowerShell Reserved Words

Below is a list of reserved words in PowerShell. These keywords are integral to PowerShell's scripting language and have specific functions and meanings.

  • Begin - Used in a script block to define a section that provides preparatory tasks before the main processing begins.
  • Break - Exits a loop or a switch statement.
  • Catch - Handles exceptions caught by a Try block.
  • Class - Defines a class.
  • Continue - Skips the current iteration of a loop and moves to the next iteration.
  • Data - Defines a data section for declarative language elements.
  • Do - Used for a loop that executes as long as or until a specified condition is true.
  • DynamicParam - Defines dynamic parameters.
  • Else - Specifies a block of commands to run when an If statement does not evaluate to true.
  • ElseIf - Defines an additional condition in an If statement.
  • End - Used in a script block to define a section that runs after the main processing is completed.
  • Exit - Exits PowerShell or a script.
  • Filter - Defines a function that processes input from the pipeline.
  • Finally - Defines a block of commands that always runs after Try and Catch blocks.
  • For - Specifies a loop that runs a specified number of times.
  • Foreach - Loops through each item in a collection.
  • Function - Defines a script block that can be reused.
  • If - Specifies a condition for running a block of commands.
  • In - Used as part of a Foreach loop.
  • Inlinescript - Defines a script block that runs in a separate, non-parallel session.
  • Interface - Defines an interface.
  • Param - Defines parameters for a script or function.
  • Process - Used in a function to process input from the pipeline.
  • Return - Exits a script or function, optionally returning a value.
  • Switch - Specifies a conditional statement with multiple conditions.
  • Throw - Generates a terminating error.
  • Trap - Specifies a block of commands to run when an error occurs.
  • Try - Specifies a block of commands for which errors will be caught in a Catch block.
  • Until - Used in a loop to specify that the loop runs until the condition is true.
  • Using - Imports types from modules or namespaces, or imports modules.
  • Var - Declares a variable in a class.
  • While - Specifies a condition for running a block of commands.

For more details on each reserved word and how they are used in PowerShell, refer to the Official PowerShell Documentation.

This list offers a glimpse into the PowerShell scripting language's syntax and structure, highlighting keywords that play a pivotal role in script development and execution. PowerShell's official documentation is a comprehensive resource for learning more about these reserved words and their usage in various scripting scenarios.


Snippet from Wikipedia: PowerShell

PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-source and cross-platform on August 18, 2016, with the introduction of PowerShell Core. The former is built on the .NET Framework, the latter on .NET (previously .NET Core).

PowerShell is bundled with all currently supported Windows versions, and can also be installed on MacOS and Linux. Since Windows 10 build 14971, PowerShell replaced Command Prompt (cmd.exe) and became the default command shell for File Explorer.

In PowerShell, administrative tasks are generally performed via cmdlets (pronounced command-lets), which are specialized .NET classes implementing a particular operation. These work by accessing data in different data stores, like the file system or Windows Registry, which are made available to PowerShell via providers. Third-party developers can add cmdlets and providers to PowerShell. Cmdlets may be used by scripts, which may in turn be packaged into modules. Cmdlets work in tandem with the .NET API.

PowerShell's support for .NET Remoting, WS-Management, CIM, and SSH enables administrators to perform administrative tasks on both local and remote Windows systems. PowerShell also provides a hosting API with which the PowerShell runtime can be embedded inside other applications. These applications can then use PowerShell functionality to implement certain operations, including those exposed via the graphical interface. This capability has been used by Microsoft Exchange Server 2007 to expose its management functionality as PowerShell cmdlets and providers and implement the graphical management tools as PowerShell hosts which invoke the necessary cmdlets. Other Microsoft applications including Microsoft SQL Server 2008 also expose their management interface via PowerShell cmdlets.

PowerShell includes its own extensive, console-based help (similar to man pages in Unix shells) accessible via the Get-Help cmdlet. Updated local help contents can be retrieved from the Internet via the Update-Help cmdlet. Alternatively, help from the web can be acquired on a case-by-case basis via the -online switch to Get-Help.

Research More

PowerShell on the Cloud

PowerShell on Containers

PowerShell Courses

Fair Use Source

PowerShell: PowerShell Fundamentals - PowerShell Basic Commands, PowerShell Inventor - PowerShell Language Designer: Jeffrey Snover, Bruce Payette, James Truher (et al.) of Microsoft on November 14, 2006; PowerShell DevOps - PowerShell SRE, PowerShell in the Cloud (Azure PowerShell - AWS PowerShell - GCP PowerShell - VMware PowerShell), PowerShell Core, Windows PowerShell, Windows Server PowerShell, Linux PowerShell (PowerShell on Ubuntu, PowerShell on Debian, PowerShell on RHEL, PowerShell on Fedora - brew install powershell), macOS PowerShell - brew install powershell, Cloud Native PowerShell - PowerShell on Kubernetes - PowerShell on AWS - PowerShell on Azure - PowerShell on GCP), PowerShell Microservices, PowerShell Containerization (PowerShell Docker - PowerShell on Docker Hub), Serverless PowerShell, PowerShell Data Science - PowerShell DataOps - PowerShell and Databases (PowerShell ORM), PowerShell ML - PowerShell DL, Functional PowerShell (1. PowerShell Immutability, 2. PowerShell Purity - PowerShell No Side-Effects, 3. PowerShell First-Class Functions - PowerShell Higher-Order Functions, PowerShell Lambdas - PowerShell Anonymous Functions - PowerShell Closures, PowerShell Lazy Evaluation, 4. PowerShell Recursion), Reactive PowerShell), PowerShell Concurrency - PowerShell Parallel Programming - Async PowerShell, PowerShell Networking, PowerShell Security - PowerShell DevSecOps - PowerShell OAuth, PowerShell Memory Allocation (PowerShell Heap - PowerShell Stack - PowerShell Garbage Collection), PowerShell CI/CD - PowerShell Dependency Management - PowerShell DI - PowerShell IoC - PowerShell Build Pipeline, PowerShell Automation - PowerShell Scripting, PowerShell Package Managers, PowerShell Modules - PowerShell Packages, PowerShell Installation (PowerShell Windows - Chocolatey PowerShell (choco search powershell, choco install powershell-core), PowerShell macOS - Homebrew PowerShell, PowerShell on Linux), PowerShell Configuration, PowerShell Observability (PowerShell Monitoring, PowerShell Performance - PowerShell Logging), PowerShell Language Spec - PowerShell RFCs - PowerShell Roadmap, PowerShell Keywords, PowerShell Data Structures - PowerShell Algorithms, PowerShell Syntax, PowerShell OOP (1. PowerShell Encapsulation - 2. PowerShell Inheritance - 3. PowerShell Polymorphism - 4. PowerShell Abstraction), PowerShell Design Patterns - PowerShell Best Practices - PowerShell Style Guide - Clean PowerShell - PowerShell BDD, PowerShell Generics, PowerShell I/O, PowerShell Serialization - PowerShell Deserialization, PowerShell APIs, PowerShell REST - PowerShell JSON - PowerShell GraphQL, PowerShell gRPC, PowerShell Virtualization, PowerShell Development Tools: PowerShell SDK, PowerShell Compiler - PowerShell Transpiler, PowerShell Interpreter - PowerShell REPL, PowerShell IDEs (JetBrains PowerShell, PowerShell Visual Studio Code), PowerShell Linter, PowerShell Community - PowerShellaceans - PowerShell User, PowerShell Standard Library - PowerShell Libraries - PowerShell Frameworks, PowerShell Testing - PowerShell TDD, PowerShell History, PowerShell Versions, PowerShell Research, PowerShell Topics, PowerShell Uses - List of PowerShell Software - Written in PowerShell - PowerShell Popularity, PowerShell Bibliography - Manning PowerShell Series - PowerShell Courses, PowerShell Glossary - PowerShell Official Glossary, PowerShell GitHub, Awesome PowerShell, PowerShell Versions. (navbar_powershell)

Reserved Words: Programming Language Keywords, aka Reserved Identifiers. (navbar_reserved_words - see also navbar_programming)


Cloud Monk is Retired (for now). Buddha with you. © 2005 - 2024 Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


powershell_reserved_words_-_powershell_keywords.txt · Last modified: 2024/03/14 18:40 by 127.0.0.1