ABOUT_LANGUAGE_KEYWORDS Short description Describes the keywords in the PowerShell scripting language. Long description PowerShell has the following language keywords. For more information, see the about topic for the keyword and the information that follows the table. Keyword Reference -------------- --------------------------------------------------- begin about_Functions, about_Functions_Advanced break about_Break, about_Trap catch about_Try_Catch_Finally class about_Classes continue about_Continue, about_Trap data about_Data_Sections define Reserved for future use do about_Do, about_While dynamicparam about_Functions_Advanced_Parameters else about_If elseif about_If end about_Functions, about_Functions_Advanced_Methods enum about_Enum exit Described in this topic filter about_Functions finally about_Try_Catch_Finally for about_For foreach about_ForEach from Reserved for future use function about_Functions, about_Functions_Advanced hidden about_Hidden if about_If in about_ForEach param about_Functions process about_Functions, about_Functions_Advanced return about_Return static about_Classes switch about_Switch throw about_Throw, about_Functions_Advanced_Methods trap about_Trap, about_Break, about_Try_Catch_Finally try about_Try_Catch_Finally until about_Do using about_Using, about_Classes var Reserved for future use while about_While, about_Do The following keywords are used by PowerShell workflows: Keyword Reference -------------- -------------------- inlinescript about_InlineScript parallel about_Parallel sequence about_Sequence workflow about_Workflows For more information about workflows, see Running PowerShell Commands in a Workflow. begin Specifies one part of the body of a function, along with the dynamicparam, process, and end keywords. The begin statement list runs one time before any objects are received from the pipeline. Syntax: function { dynamicparam {} begin {} process {} end {} } break Causes a script to exit a loop. Syntax: while () { ... break ... } catch Specifies a statement list to run if an error occurs in the accompanying try statement list. An error type requires brackets. The second pair of brackets indicates that the error type is optional. Syntax: try {} catch [[]] {} class Specifies a new class in PowerShell. Syntax: class { [[hidden] [static] ...] [([argument-list>]) {} ...] [[hidden] [static] ...] } continue Causes a script to stop running a loop and to go back to the condition. If the condition is met, the script begins the loop again. Syntax: while () { ... continue ... } data In a script, defines a section that isolates data from the script logic. Can also include if statements and some limited commands. Syntax: data [-supportedCommand ] {} do Used with the while or until keyword as a looping construct. PowerShell runs the statement list at least one time, unlike a loop that uses while. Syntax for while: do {} while () Syntax for until: do {} until () dynamicparam Specifies one part of the body of a function, along with the begin, process, and end keywords. Dynamic parameters are added at runtime. Syntax: function { dynamicparam {} begin {} process {} end {} } else Used with the if keyword to specify the default statement list. Syntax: if () {} else {} elseif Used with the if and else keywords to specify additional conditionals. The else keyword is optional. Syntax: if () {} elseif () {} else {} end Specifies one part of the body of a function, along with the dynamicparam, begin, and end keywords. The end statement list runs one time after all the objects have been received from the pipeline. Syntax: function { dynamicparam {} begin {} process {} end {} } enum enum is used to declare an enumeration; a distinct type that consists of a set of named labels called the enumerator list. Syntax: enum {