Improved PowerShell grammar Documentation

  • Comments 5

Bruce Payette is a co-designer of the PowerShell language and the development lead for its implementation. From that, you might guess that his book: Windows PowerShell in Action would provide a great explanation of the language and how to use it – you'd be right.

In the past, we've posted a PowerShell grammar document but a number of you have provided feedback that it wasn't as helpful as it could be. Bruce has worked with his publisher, Manning Press, to rectify that situation by posting Appendix C: The PowerShell grammar on the website (see the link above). This chapter provides the PowerShell grammar annotated with notes and examples to help explain what's happening.

Many thanks Bruce and Manning Press for making this available.

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at:
Visit the Windows PowerShell ScriptCenter at:

Leave a Comment
  • Please add 4 and 8 and type the answer here:
  • Post
  • PingBack from

  • Good news!

    Although there's a typo in C.2.10

    Parameters can alternatively be specified using the param statement:

       function foo ($a1, $a2) { begin { ... } process { ... } end { ... } }

    The example presumably should actually show the use of the param statement.

  • This is good.  I think you should also include and maintain a formal syntax map in the SDK.

    Developers and vendors such as producers of syntax higlighters usually work from a syntax map.

  • I saw this too.

    I would also like to see the *Token (lexer) definitions.

    Isn't there a grammar in the SDK somewhere?

  • Hi, I'm working on an editor/debugging type tool for PowerShell scripts and need a correct PowerShell

Page 1 of 1 (5 items)

Improved PowerShell grammar Documentation