Customizing the PowerShell Environment
PowerShell provides an amazing level of customization and transparency. In this chapter, we will discuss how PowerShell supports configuration using three types of variables: automatic, preference, and environment. Automatic variables are created and used by PowerShell to support its operations and can be read by scripts to get context-specific information. Preference variables control PowerShell’s behavior and can be modified to suit our needs. Environment variables are not specific to PowerShell. They are variables used by Windows applications including PowerShell and can be created, read, and set by PowerShell scripts. We’ll review how to use aliases to create our own names for PowerShell cmdlets. We will use PowerShell drives to dynamically create short names for provider locations. Finally, we’ll discuss how to use all these features to customize PowerShell sessions on startup using a special script called a profile.