setup-dotnet/__tests__/clear-toolcache.ps1

13 lines
432 B
PowerShell
Raw Normal View History

2021-02-04 12:14:09 +00:00
$dotnetPaths = @{
2021-06-28 08:44:40 +00:00
Linux = "/usr/share/dotnet"
macOS = "$env:HOME/.dotnet"
Windows = "$env:ProgramFiles\dotnet", "$env:LocalAppData\Microsoft\dotnet"
2021-02-03 12:13:32 +00:00
}
2021-06-28 08:44:40 +00: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 12:13:32 +00:00
}
2021-02-04 11:24:06 +00:00
}