setup-dotnet/__tests__/clear-toolcache.ps1

13 lines
353 B
PowerShell
Raw Normal View History

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