Files
runner-images/images/win/post-generation/Dotnet.ps1
2021-05-13 21:12:54 +03:00

15 lines
762 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
$dotnetPath = "$env:USERPROFILE\.dotnet\tools"
if (-not $latestPath.Contains($dotnetPath))
{
$latestPath = "$dotnetPath;$latestPath"
[System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine)
}
# Delete empty nuget.config file created by choco and recreate the config using the 'dotnet nuget list source command'
# before choco or powershells ancient embedded nuget does to prevent the issue with downloading packages from nuget.org
# https://github.com/actions/virtual-environments/issues/3038
Remove-Item $env:APPDATA\NuGet\NuGet.Config -Force
dotnet nuget list source