Path Environment Variable


Scenario/Problem: You have scripts within a local folder which you want PowerShell to recognize such that you do not need to use the full path name.


Solution: Add the local directory path to the PSModulePath variable.

You add the local folder’s path to the PSModule environment variable by entering the following command in the PowerShell command prompt (substituting <folder path> with the local directory path), as shown in Listing 2.2.

Listing 2.2. Adding a Folder Path to the PSModulePath


$env:PSModulePath = $env:PSModulePath + ";c:<folder path>"



Tip

Add the same exact command line into the PowerShell profile configuration file to always have your local folder added to the PSModulePath. See http://technet.microsoft.com/en-us/library/dd315342.aspx for more information about PowerShell profiles.


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

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