Created
November 18, 2024 10:43
-
-
Save mika76/f9f966d9bd504c819f7ff11452b5aea4 to your computer and use it in GitHub Desktop.
TFS Delete Workspaces owner by user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tries to match everything until the owner field as the workspace name (thanks redgate sql source control) | |
tf workspaces /owner:domain\username| | |
Select-Object -Skip 2 | | |
ForEach-Object { | |
if ($_ -match "^(.*?)Username") { | |
$workspace = $Matches[1].Trim() | |
Write-Host "Will delete workspace: $workspace" | |
tf workspace /delete "$workspace;domain\username" /noprompt | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment