O'Reilly logo

PowerShell Troubleshooting Guide by Michael Shepard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. PowerShell Peculiarities

In many ways, PowerShell is different (as a language) than other traditional programming languages. Some of PowerShell's peculiarities will be presented in this chapter, as well as some guidance on how to avoid common pitfalls. Here are the topics we'll cover in this chapter:

  • Strings (quoting, substitution, and escaping)
  • Function return values
  • Pipeline processing
  • Error handling and non-terminating errors

PowerShell strings

In PowerShell, either double quotes or single quotes can be used to express string literals. For instance, the following values are the same:

"HELLO WORLD"
'HELLO WORLD'

Using both kinds of quotes can be useful when quoting strings which themselves contain quotes, such as the following:

"I can't stop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required