Files
versions-package-tools/clean-toolcache.ps1
T

14 lines
353 B
PowerShell
Raw Normal View History

param (
[string] $ToolName
)
$targetPath = $env:AGENT_TOOLSDIRECTORY
if ($ToolName) {
$targetPath = Join-Path $targetPath $ToolName
}
if (Test-Path $targetPath) {
Get-ChildItem -Path $targetPath -Recurse | Where-Object { $_.LinkType -eq "SymbolicLink" } | ForEach-Object { $_.Delete() }
Remove-Item -Path $targetPath -Recurse -Force
}