This commit is contained in:
Vladimir Safonkin 2021-02-03 15:13:32 +03:00
parent 7261940ea5
commit a3d47e556c
1 changed files with 23 additions and 1 deletions

View File

@ -1,4 +1,26 @@
Write-Host $args[0] Write-Host $args[0]
Write-Host $env:PATH $os = $args[0]
$linuxDotnetPaths = @("/usr/share/dotnet")
$macOSDotnetPaths = @("/Users/runner/.dotnet")
$windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", "$env:ProgramFiles\dotnet/*")
$pathsToClear = @()
if ($os == "linux") {
$pathsToClear = $linuxDotnetPaths
} elseif ($os == "macOS") {
$pathsToClear = $macOSDotnetPaths
} elseif ($os == "windows") {
$pathsToClear = $windowsDotnetPaths
}
foreach ($path in $pathsToClear) {
if (Test-Path $path) {
Write-Host "Clear $path"
Remove-Item $path -Recurse -Force
}
}
dotnet --info dotnet --info