Chapter 19. PowerShell’s scripting language

This chapter covers

  • Logical conditions
  • Loops
  • Branching
  • Code formatting

Although we firmly maintain that PowerShell isn’t a scripting language, it does—like many command-line shells—contain a scripting language. This language can prove useful when you want to automate complex, multipart processes that may require different actions to be taken for different scenarios. PowerShell’s language is definitely simple, consisting of less than two dozen commands usually referred to as keywords, but it’s more than adequate for most jobs.

Note

The list of keywords, plus their definitions and references to more information, can be found in the help file about_Language_Keywords.

The ability ...

Get PowerShell in Depth, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.