TfsCmdlets.Types.ps1xml

<?xml version="1.0" encoding="Windows-1252"?>
<Types>
    <Type>
        <Name>Microsoft.TeamFoundation.Client.TfsConfigurationServer</Name>
        <Members>
            <ScriptProperty>
                <Name>Name</Name>
                <GetScriptBlock>$this.Uri.Host</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.TeamFoundation.Client.BuildController</Name>
        <Members>
            <ScriptProperty>
                <Name>Collection</Name>
                <GetScriptBlock>$this.BuildServer.TeamProjectCollection.Name</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.TeamFoundation.Client.TeamFoundationTeam</Name>
        <Members>
            <ScriptProperty>
                <Name>IsDefault</Name>
                <GetScriptBlock>
                    try
                    {
                        $tpcId = $this.GetProperty('SecuringHostId')
                        $tpId = $this.Project
 
                        if ($TfsTpcConnection -and ($TfsTpcConnection.InstanceId -eq $tpcId))
                        {
                            $tpc = $TfsTpcConnection
                        }
                        else
                        {
                            $tpc = Get-TfsTeamProjectCollection | ? InstanceId -eq $tpcId
                        }
                        $teamService = $tpc.GetService([type]'Microsoft.TeamFoundation.Client.TfsTeamService')
                        return ($teamService.GetDefaultTeamId("$tpId") -eq $this.Identity.TeamFoundationId)
                    }
                    catch
                    {
                        return $null
                    }
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.TeamFoundation.WorkItemTracking.Client.Project</Name>
        <Members>
            <ScriptProperty>
                <Name>ProcessTemplate</Name>
                <GetScriptBlock>
                    try
                    {
                    $projectName = $null
                    $projectState = $null
                    $templateId = $null
                    $projectProperties = $null
 
                    $tpc = $this.Store.TeamProjectCollection
                    $css = $tpc.GetService([type]'Microsoft.TeamFoundation.Server.ICommonStructureService')
                    $css.GetProjectProperties($this.Uri, [ref] $projectName, [ref] $projectState, [ref] $templateId, [ref] $projectProperties)
 
                    $processTemplate = $projectProperties | ? Name -eq "Process Template" | select -ExpandProperty Value
 
                    if([string]::IsNullOrEmpty($processTemplate))
                    {
                    $processTemplate = "(Unknown)"
                    }
 
                    return $processTemplate
                    }
                    catch
                    {
                    return "(Error)"
                    }
                </GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Collection</Name>
                <GetScriptBlock>$this.Store.TeamProjectCollection.DisplayName</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem</Name>
        <Members>
            <ScriptProperty>
                <Name>AssignedTo</Name>
                <GetScriptBlock>
                    try
                    {
                    return $this.Fields["System.AssignedTo"].Value
                    }
                    catch
                    {
                    return "(Error)"
                    }
                </GetScriptBlock>
                <SetScriptBlock>
                    $this.Fields["System.AssignedTo"].Value = $args[0]
                </SetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>WorkItemType</Name>
                <GetScriptBlock>$this.Type.Name</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Collection</Name>
                <GetScriptBlock>$this.Store.TeamProjectCollection.DisplayName</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.TeamFoundation.Client.TfsTeamProjectCollection</Name>
        <Members>
            <ScriptProperty>
                <Name>Name</Name>
                <GetScriptBlock>$this.CatalogNode.Resource.DisplayName</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>InstanceId</Name>
                <GetScriptBlock>$this.CatalogNode.Resource.Properties["InstanceId"]</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.TeamFoundation.Server.NodeInfo</Name>
        <Members>
            <ScriptProperty>
                <Name>NodeType</Name>
                <GetScriptBlock>
                    switch($this.StructureType)
                    {
                    'ProjectModelHierarchy' { return 'Area' }
                    'ProjectLifecycle' { return 'Iteration' }
                    default { return "(Unknown: $($this.StructureType))" }
                    }
                </GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>RelativePath</Name>
                <GetScriptBlock>
                    $this.Path.SubString($this.Path.IndexOf('\', $this.Path.IndexOf('\', 2)+1))
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
</Types>