setup-dotnet/__tests__/clear-toolcache.ps1

13 lines
416 B
PowerShell
Raw Normal View History

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