setup-dotnet/__tests__/clear-toolcache.ps1

13 lines
353 B
PowerShell
Raw Normal View History

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