-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from SteveL-MSFT/add-path
Fix `add-path.ps1` to use $PSScriptRoot instead of $PWD
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
# This script will add the current directory to the PATH environment variable | ||
# This script will add the script directory to the PATH environment variable | ||
# for the current user. This is useful for development purposes. | ||
|
||
$pathSeparator = [System.IO.Path]::PathSeparator | ||
$paths = $env:PATH.Split($pathSeparator) | ||
if ($paths -notcontains $PWD) { | ||
$env:PATH = "$PWD" + $pathSeparator + $env:PATH | ||
Write-Host -ForegroundColor Green "Added $PWD to `$env:PATH" | ||
if ($paths -notcontains $PSScriptRoot) { | ||
$env:PATH = "$PSScriptRoot" + $pathSeparator + $env:PATH | ||
Write-Host -ForegroundColor Green "Added $PSScriptRoot to `$env:PATH" | ||
} |