Skip to content

Instantly share code, notes, and snippets.

@dustinchilson
Created December 6, 2012 13:47
Show Gist options
  • Save dustinchilson/4224557 to your computer and use it in GitHub Desktop.
Save dustinchilson/4224557 to your computer and use it in GitHub Desktop.
Cleanup Script for Vault files in TFS
$files = (dir -recurse . | ? { $_.fullname -match "_sgbak" -and $_.PSIsContainer } | % { $_.fullname })
for ($i=0; $i -lt $files.length; $i++)
{
tf undo /recursive $files[$i]
tf delete /recursive $files[$i]
}
$files = (ls -r . | ? {$_.name -match "\b.bak\b" -and !$_.PSIsContainer} | % { $_.fullname })
for ($i=0; $i -lt $files.length; $i++)
{
tf undo $files[$i]
tf delete $files[$i]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment