Skip to content

Instantly share code, notes, and snippets.

@berkayyildi
Created October 19, 2020 14:51
Show Gist options
  • Save berkayyildi/4a5729874c19aa0ecfa4dc340ed92314 to your computer and use it in GitHub Desktop.
Save berkayyildi/4a5729874c19aa0ecfa4dc340ed92314 to your computer and use it in GitHub Desktop.
TFS Extract Pending Changes to Zip File - Visual Studio 2019
$Destination = "C:\Users\berkay.yildiz\Desktop\"
$RarApp = "C:\Program Files\WinRAR\Rar.exe"
$projectDirectory = "C:\SOFTWARE\MY_PROJECT_DIRECTORY\Codes"
Set-Alias tf "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe" #For Visual Studio 2019
cd $projectDirectory
$changeset = tf status | % {[Regex]::Matches($_, "edit(.*)")} | % {$_.Groups[1].Value}| % {$_ -Replace " ",""}
ForEach ($files in Get-ChildItem $changeset) {
& $RarApp a $($Destination + "yedek" + ".rar") $($files.FullName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment