Skip to content

Instantly share code, notes, and snippets.

@alatas
Last active September 8, 2016 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alatas/866ce0a26e5fd8c59e938ebbfcde1c20 to your computer and use it in GitHub Desktop.
Save alatas/866ce0a26e5fd8c59e938ebbfcde1c20 to your computer and use it in GitHub Desktop.
Remove TFS related files and unbind solution files from TFS (Powershell)
Get-ChildItem *.vspscc -Recurse | %{Write-Host "Deleting *.vssscc -> "$_.FullName ; Remove-Item $_.FullName -Force};Get-ChildItem *.vssscc -Recurse | %{Write-Host "Deleting *.vspscc -> "$_.FullName ; Remove-Item $_.FullName -Force};Get-ChildItem *.sln -Recurse | %{$name=$_.FullName ; Write-Host "Changing *.sln -> "$name ; Copy-Item $name $name".bak" -Force ; (Get-Content $name -Raw) | %{$_ -replace "(?s)\tGlobalSection\(TeamFoundationVersionControl\).*?EndGlobalSection","" }| Set-Content $name -Encoding UTF8 -Force ; Write-Host "Backup File -> "$name".bak"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment