setup-dotnet/__tests__/clear-toolcache.ps1

13 lines
432 B
PowerShell
Raw Normal View History

2021-02-04 20:14:09 +08:00
$dotnetPaths = @{
2021-06-28 16:44:40 +08:00
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-06-28 16:44:40 +08:00
foreach ($srcPath in $dotnetPaths[$args[0]]) {
if (Test-Path $srcPath) {
Write-Host "Move $srcPath path"
$dstPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
Move-Item -Path $srcPath -Destination $dstPath
2021-02-03 20:13:32 +08:00
}
2021-02-04 19:24:06 +08:00
}