The PowerShell Language

  • Bryan Cafferky


In this chapter, we will introduce the PowerShell language. We will start by considering some of the challenges faced when learning PowerShell, which can be discouraging. Then we will review a simple script so as to get a feel for the language. From there we will discuss comparison and mathematical operators and logical operands. PowerShell commands are called cmdlets, pronounced command-lets. We’ll discuss Microsoft’s cmdlet naming conventions, then review of some of the most prominent cmdlets. After this, we’ll discuss how to use variables and go over the supported data types. PowerShell has advanced support for string manipulation, and we will review some of these features, including regular expressions, which are used for string matching, and here strings, which allow long string values that include special characters. Then we’ll discuss PowerShell’s control flow statements that support conditional code execution and various looping constructs. We will close the chapter by reviewing PowerShell’s support for arrays and a special object called a hash table. Hash tables are arrays of key/value pairs ideal for code translations, such as a state abbreviation code for the state name. By the end of this chapter, you will have a basic grasp of the PowerShell language.


Regular Expression Hash Table Code Block Switch Statement Mathematical Operator 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Bryan Cafferky 2015

Authors and Affiliations

  • Bryan Cafferky
    • 1
  1. 1.MAUS

Personalised recommendations