setup-dotnet/__tests__/clear-toolcache.ps1

13 lines
353 B
PowerShell
Raw Normal View History

2021-02-04 15:14:09 +03:00
$dotnetPaths = @{
Linux = @("/usr/share/dotnet")
macOS = @("$env:HOME/.dotnet")
Windows = @("$env:ProgramFiles\dotnet/*",
"$env:LocalAppData\Microsoft\dotnet/*")
2021-02-03 15:13:32 +03:00
}
2021-02-04 15:14:09 +03:00
foreach ($path in $dotnetPaths[$args[0]]) {
2021-02-03 15:13:32 +03:00
if (Test-Path $path) {
2021-02-03 15:20:22 +03:00
Write-Host "Clear $path path"
2021-02-03 17:46:39 +03:00
Remove-Item $path -Recurse -Force
2021-02-03 15:13:32 +03:00
}
2021-02-04 14:24:06 +03:00
}