How it works...

As we saw in Listing the various providers in PowerShell, Env is a provider that contains environment-specific configuration. Most of these configuration options are also exposed to us as environment variables. We are able to use the cmdlets Get-ChildItem and Get-Item to list the values of the available environment variables because Env: is a drive within the Env provider. As environment variables do not have child items, Get-Item and Get-ChildItem return the same output.

Since these variables determine how your session behaves with you, changes made to these values are ephemeral. In other words, the value of $env:PATH is picked from the configuration on your Linux computer. The manual change made to $env:PATH made within a PowerShell session remains as long as the PowerShell session is alive. Changes made to $env:PATH does not change the value within the system itself.

If you would like to make a certain change permanent, edit the .bashrc or the ~/.bash_profile configuration files. If you would like to use PowerShell instead of Bash, make the change in your PowerShell profile. Instructions on how to do that can be found in the recipe, Enabling automated execution of commands for each load, in the chapter, Preparing for Administration using PowerShell.

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

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