mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-10 20:53:10 +08:00
rework dotnet script
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user