Get-VSTeamProject
SYNOPSIS
Returns a list of projects in the Team Services or Team Foundation Server account.
SYNTAX
List (Default)
Get-VSTeamProject [-StateFilter <String>] [-Top <Int32>] [-Skip <Int32>] [-IncludeCapabilities]
[<CommonParameters>]
ByID
Get-VSTeamProject [-Id <String>] [-IncludeCapabilities] [<CommonParameters>]
ByName
Get-VSTeamProject [-IncludeCapabilities] -Name <String> [<CommonParameters>]
DESCRIPTION
The list of projects returned can be controlled by using the stateFilter, top and skip parameters.
You can also get a single project by name or id.
You must call Set-VSTeamAccount before calling this function.
EXAMPLES
Example 1
Get-VSTeamProject
This will return all the WellFormed team projects.
Example 2
Get-VSTeamProject -top 5 | Format-Wide
This will return the top five WellFormed team projects only showing their name
PARAMETERS
-StateFilter
Returns team projects in a specific team project state. The acceptable values for this parameter are:
- WellFormed
- CreatePending
- Deleting
- New
- All
Type: String
Parameter Sets: List
Aliases:
Required: False
Position: Named
Default value: WellFormed
Accept pipeline input: False
Accept wildcard characters: False
-Top
Specifies the maximum number to return.
Type: Int32
Parameter Sets: List
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Skip
Defines the number of team projects to skip. The default value is 0
Type: Int32
Parameter Sets: List
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Id
The id of the project to return.
Type: String
Parameter Sets: ByID
Aliases: ProjectID
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeCapabilities
Will return additional information about the project.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Name
Specifies the team project for which this function operates.
You can tab complete from a list of available projects.
You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call.
Type: String
Parameter Sets: ByName
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
You can use PowerShell default values to set top to any value you like.
$Global:PSDefaultParameterValues[" -vsteam :top"] = 500
However, this function is called by the Project cache which is used by the project validation code. If the value of top is not high enough validation may fail. By default this function returns all projects.
Prerequisites:
Set the account and version that all calls will use with Set-VSTeamAccount. Default version sets to API version 3.0 (TFS2017) if not manually set.
tips:
- check called version of the API with Get-VSTeamAPIVersion or Get-VSTeamInfo
- use Set-VSTeamDefaultProject to set default project for every call
- use Set-VSTeamDefaultAPITimeout to change the default timeout of 60 seconds for all calls.
- use Profiles to load an account and the correct version