From c101287fd83cc310e38f6d19d3a9547324882373 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 1 Oct 2020 11:41:42 +0300 Subject: [PATCH] rework dotnet script --- images/win/post-generation/Dotnet.ps1 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/images/win/post-generation/Dotnet.ps1 b/images/win/post-generation/Dotnet.ps1 index ea5a2de5..5f38eaec 100644 --- a/images/win/post-generation/Dotnet.ps1 +++ b/images/win/post-generation/Dotnet.ps1 @@ -1,12 +1,9 @@ $latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) - $dotnetPath = "$env:USERPROFILE\.dotnet\tools" -if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools")) -{ - $latestPath = $latestPath.Replace("C:\Users\VssAdministrator\.dotnet\tools", "$dotnetPath") -} if (-not $latestPath.Contains($dotnetPath)) { $latestPath = "$dotnetPath;$latestPath" -} \ No newline at end of file +} + +[System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine) \ No newline at end of file