From 1f525e3e4636a38a10eb29f2ada3f55c1317d8c0 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 7 May 2018 14:52:30 -0700 Subject: [PATCH] Fix build.psm1 to not add tool path to $PATH twice --- build.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index 75c227060e0..b6dba8d0b23 100644 --- a/build.psm1 +++ b/build.psm1 @@ -160,7 +160,7 @@ $Environment = Get-EnvironmentInformation # Autoload (in current session) temporary modules used in our tests $TestModulePath = Join-Path $PSScriptRoot "test/tools/Modules" -if ( $env:PSModulePath -notcontains $TestModulePath ) { +if ( -not $env:PSModulePath.Contains($TestModulePath) ) { $env:PSModulePath = $TestModulePath+$TestModulePathSeparator+$($env:PSModulePath) } @@ -959,7 +959,7 @@ function Publish-PSTestTools { dotnet publish --output bin --configuration $Options.Configuration --framework $Options.Framework --runtime $Options.Runtime $toolPath = Join-Path -Path $tool.Path -ChildPath "bin" - if ( $env:PATH -notcontains $toolPath ) { + if ( -not $env:PATH.Contains($toolPath) ) { $env:PATH = $toolPath+$TestModulePathSeparator+$($env:PATH) } } finally {