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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access