Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-VSTeamProject (and the cache) still only returns the top 100 by default #373

Closed
2 of 7 tasks
ghvanderweg opened this issue Nov 9, 2020 · 5 comments
Closed
2 of 7 tasks
Labels
bug when a bug has been identified or filed Investigating when an issue needs further investigation by a maintainer. Used only by maintainer.

Comments

@ghvanderweg
Copy link

It seems to me that #363 wasn't fixed in #367.

Get-VSTeamProject still only returns the first 100 projects, and only those projects are saved in the cache.

Adding Top to the PSDefaultParameterValues helps with calling Get-VSTeamProject, but it doesn't increase the cache size. Trying to get a project by name that's not in the first 100 projects still fails validation.

Steps to reproduce

Assuming an account with 129 projects.

(Get-VSTeamProject).Count
$PSDefaultParameterValues.Add("*-VSTeam*:Top",1000)
(Get-VSTeamProject).Count
Get-VSTeamProject -Name 'TestProject101'

Expected behavior

129
129

Name         Description
----         -----------
TestProject101

Actual behavior

100
129
Get-VSTeamProject: Cannot validate argument on parameter 'Name'. 'TestProject101' is invalid

Environment data

OS

  • macOS
  • Windows
  • Linux

Server

  • TFS 2017
  • TFS 2018
  • Azure DevOps Server
  • Azure DevOps Service
> Get-VSTeamAPIVersion
Name                           Value
----                           -----
HierarchyQuery                 5.1-preview
Build                          5.1
DistributedTaskReleased        5.1
ServiceEndpoints               5.0-preview
Graph                          6.0-preview
Release                        5.1
Tfvc                           5.1
TaskGroups                     6.0-preview
MemberEntitlementManagement    6.0-preview
Pipelines                      5.1-preview
Git                            5.1
ExtensionsManagement           6.0-preview
VariableGroups                 5.1-preview.1
Packaging                      6.0-preview
Core                           5.1
Version                        VSTS
DistributedTask                6.0-preview
Policy                         5.1
Processes                      6.0-preview
> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@SebastianSchuetze SebastianSchuetze added Investigating when an issue needs further investigation by a maintainer. Used only by maintainer. bug when a bug has been identified or filed labels Nov 9, 2020
@SebastianSchuetze
Copy link
Collaborator

thanks! We are checking this.

@DarqueWarrior
Copy link
Collaborator

I think I tested this on Azure DevOps Server. Let me see if the service behaves differently.

@DarqueWarrior
Copy link
Collaborator

I finally had time to test on Azure DevOps Services. It returns 100 even if you don't pass the top parameter.

@DarqueWarrior
Copy link
Collaborator

It is also odd because the 100 it returns is not always the same.

@DarqueWarrior
Copy link
Collaborator

To get more than 100 back you have to set the Top parameter. I think I will add a function that makes setting and clearing that easier than having to use PSDefaultParameterValues. So users with more than 100 projects are going to have to called Set-VSTeamDefaultProjectCount. I will also make it sticky like the default project so if you start a new session you don't have to call it again once you set it to a value that works for you.

DarqueWarrior added a commit that referenced this issue Dec 6, 2020
* Added Set and Clear DefaultProjectCount

* Updated changelog.

* Reduced redundant code.

* Fix unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug when a bug has been identified or filed Investigating when an issue needs further investigation by a maintainer. Used only by maintainer.
Projects
None yet
Development

No branches or pull requests

3 participants