add common helpers
This commit is contained in:
13
helpers/clean-toolcache.ps1
Normal file
13
helpers/clean-toolcache.ps1
Normal file
@@ -0,0 +1,13 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user