Short description

Lists the reserved words that cannot be used as identifiers because they have a special meaning in PowerShell.

Long description

There are certain words that have special meaning in PowerShell. When these words appear without quotation marks, PowerShell attempts to apply their special meaning rather than treating them as character strings. To use these words as parameter arguments in a command or script without invoking their special meaning, enclose the reserved words in quotation marks.

The following are the reserved words in PowerShell:

assembly         exit            process
base             filter          public
begin            finally         return
break            for             sequence
catch            foreach         static
class            from (*)        switch
command          function        throw
configuration    hidden          trap
continue         if              try
data             in              type
define (*)       inlinescript    until
do               interface       using
dynamicparam     module          var (*)
else             namespace       while
elseif           parallel        workflow
end              param
enum             private

(*) These keywords are reserved for future use.

Several language keywords, including foreach, if, for, and while, have their own help articles. To view them, type Get-Help about_ and add the keyword. For example, to get information about the foreach statement, type:

Get-Help about_ForEach

For information about the filter statement or the return statement syntax, type:

Get-Help about_Functions

For information about other reserved words, type:

Get-Help <Reserved_Word>


Not every reserved word has its own help article. If Get-Help does not return an article, you can search for articles that talk about the reserved word using the following command:

Get-Help <Reserved_Word> -Category:HelpFile

See also