How it works...

PowerShell is built with some variables that control its behaviour, and administrators are allowed to modify some of them to suit the needs. Some variables, however, cannot be modified; they are contextual, and add some amount of flexibility (or modularity, as the case might be) to the shell.

One such example would be $PWD, which contains the path of the present directory. This variable changes itself based on the execution of Set-Location. Values cannot be explicitly assigned to such variables; setting values explicitly would have no effect on the behaviour of the shell.

Some variables, on the other hand, accept values, and let us control the execution of commands and scripts. We shall look at an example in the next recipe.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.242.165