How to find area paths/iteration paths changed in a project or project collection?

Here is a code snippet which you can use to find out area paths/iteration paths changed in a project or project collection.

# Load Client Assembly
[Reflection.Assembly]::Load(“Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”);
 
# Change the server as per your setup
$tfsCollectionUrl = “<https://myserver:8080/tfs/DefaultCollection”;>

# Connect to tfs
$tfsCollection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($tfsCollectionUrl);
$css = $tfsCollection.GetService([Microsoft.TeamFoundation.Server.ICommonStructureService]);

#Query for changed nodes
$xml = $css.GetChangedNodes(0);

Write-Host ” ================================ “
Write-Host “Changed Nodes: “$xml

#Redirect the output to a file

$xml >out.txt