February 2013
Intermediate to advanced
632 pages
20h 20m
English
This chapter covers
Scope is one of the most confusing things about PowerShell when you’re a newcomer, and even experienced gurus get tripped up by it from time to time. If you’re just using the shell as a shell—meaning you’re running commands and seeing the results onscreen—then scope won’t affect your life much. It’s when you start writing scripts, functions, and modules that scope comes into play.
Scope is a form of containerization. Certain elements in PowerShell are considered scoped elements, and when you create one it only exists within the container, or scope, in which you created it. Generally speaking, it can only be used from within ...