setup-dotnet/__tests__/clear-toolcache.ps1
js6pak b4737b42ef
Rename toolcache directory instead of moving to tmp
This further enhances time savings seen in #213, down from a few minutes to seconds.
2024-07-21 00:46:16 +02:00

13 lines
416 B
PowerShell

$dotnetPaths = @{
Linux = "/usr/share/dotnet"
macOS = "$env:HOME/.dotnet"
Windows = "$env:ProgramFiles\dotnet", "$env:LocalAppData\Microsoft\dotnet"
}
foreach ($srcPath in $dotnetPaths[$args[0]]) {
if (Test-Path $srcPath) {
$dstPath = "$srcPath-" + [IO.Path]::GetRandomFileName()
Write-Host "Moving $srcPath to $dstPath"
Move-Item -Path $srcPath -Destination $dstPath
}
}