MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
442 stars 155 forks source link

Get-VSTeamFeed Throws Error When ID Specified #465

Closed jmb1304 closed 1 year ago

jmb1304 commented 2 years ago

Steps to reproduce

Note: Actual Feed ID was replaced with "<Your Feed ID>"

Set-VSTeamAccount -Account "https://dev.azure.com/Contoso/" -PersonalAccessToken $pat -Force
Get-VSTeamFeed -Id "<Your Feed ID>" -Verbose
VERBOSE: Team Module/7.6.1 (Windows) PowerShell/5.1.19041.1620
VERBOSE: GET https://feeds.dev.azure.com/contoso//_apis/packaging/feeds/<Your Feed ID>?api-version=6.0-preview with 0-byte payload
WARNING: An error occurred: The remote server returned an error: (404) Not Found.
WARNING: The feed with ID '<Your Feed ID>' doesn't exist.

Expected behavior

I expected that it would load the details for the feed specified.

Actual behavior?

The command returned an error.

Note: Actual Feed ID was replaced with "<Your Feed ID>"

VERBOSE: Team Module/7.6.1 (Windows) PowerShell/5.1.19041.1620
VERBOSE: GET https://feeds.dev.azure.com/contoso//_apis/packaging/feeds/<Your Feed ID>?api-version=6.0-preview with 0-byte payload
WARNING: An error occurred: The remote server returned an error: (404) Not Found.
WARNING: The feed with ID '<Your Feed ID>' doesn't exist.

This same request was manually tested in a browser and it worked correctly. The ID used was the actual valid ID from the feed.

On Which OS have you tried it?

Windows

What was your server version?

Azure DevOps Services

Other server version

No response

Log output of used API

_getApiVersion : Cannot validate argument on parameter 'Service'. The argument "Version" does not belong to the set 
"Build,Release,Core,Git,DistributedTask,DistributedTaskReleased,VariableGroups,Tfvc,Packaging,MemberEntitlementManagement,ExtensionsManagement,ServiceEndpoints,Graph,TaskGroups,Policy,Processes,HierarchyQuery,Pipelines,Billing,Wiki,WorkItemTracking" specified by the ValidateSet attribute. Supply an argument 
that is in the set and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\VSTeam\7.6.1\vsteam.functions.ps1:3596 char:57
+          Version                     = $(_getApiVersion Version)
+                                                         ~~~~~~~
    + CategoryInfo          : InvalidData: (:) [_getApiVersion], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,_getApiVersion

Billing                     : 5.1-preview.1
Build                       : 5.1
Core                        : 5.1
DistributedTask             : 6.0-preview
DistributedTaskReleased     : 5.1
ExtensionsManagement        : 6.0-preview
Git                         : 5.1
Graph                       : 6.0-preview
HierarchyQuery              : 5.1-preview
MemberEntitlementManagement : 6.0-preview
Packaging                   : 6.0-preview
Pipelines                   : 5.1-preview
Policy                      : 5.1
Processes                   : 6.0-preview
Release                     : 5.1
ServiceEndpoints            : 5.0-preview
TaskGroups                  : 6.0-preview
Tfvc                        : 5.1
VariableGroups              : 5.1-preview.1
Version                     :
Wiki                        : 6.0
WorkItemTracking            : 6.0-preview.1

Log output of $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1620
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1620
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
mnieto commented 1 year ago

@jmb1304 this behaviour is because with current parameters, when you query by id, without project, it will only list Feeds at organization level. To list Feeds at project level it is necessary to add the project as a parameter. Current implementation does not allow project parameter.

I will create a PR to fix this, but I cannot promise a date

mnieto commented 1 year ago

Duplicate of #379 ?

SebastianSchuetze commented 1 year ago

if @jmb1304 is note disagreeing later then I support @mnieto comment. If you have a global feed and still have the problem, then feel free to open it again.