rework dotnet script

This commit is contained in:
Dibir Magomedsaygitov
2020-10-01 11:41:42 +03:00
parent 91ee0cc268
commit c101287fd8

View File

@@ -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"
}
}
[System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine)