PowerShell / PowerShell/PSResourceGet

Find-PSResource is not listing all modules in repository (i.e. wildcard)

Offen
#520 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Area-Find feature_request Status-Investigating
Vorherrschende Sprache
C#
Sterne
576
Forks
114
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
7

Beschreibung

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.
Steps to reproduce

I'm trying to list available modules in a Azure Artifacts repository (connected trough v2) but the Find-PSResource requires the name parameter (and wildcard is not supported in ADOFeed).

Could this possibly be related to the #352, which seams to have been resolved in 3.0.11-beta?

Also guessing that this issue #302 should be taken in to consideration.

  1. Register repository
Register-PSResourceRepository -Name 'MyRepo' -URL 'https://pkgs.dev.azure.com/<organization>/<project>/_packaging/<feedname>/nuget/v2' -Trusted 
  1. Try to list available modules in the repository
Find-PSResource -Repository MyRepo

Find-PSResource: Name parameter must be provided.

Find-PSResource -Name '*' -Repository MyRepo

Find-PSResource: -Name '*' is not supported for Find-PSResource so all Name entries will be discarded.

Find-PSResource -Name 'P*' -Repository MyRepo

Find-PSResource: Searching through ADOFeed with wildcard in Name is not supported, so PSStenaNew repository will be skipped.

Expected behavior
I would expect the same behavior as the old Find-Module (i.e. list the available modules)
Actual behavior
Find-PSResource -Repository MyRepo

**Find-PSResource: Name parameter must be provided.**
  
```powershell
Find-PSResource -Name '*' -Repository MyRepo

Find-PSResource: -Name '*' is not supported for Find-PSResource so all Name entries will be discarded.

Find-PSResource -Name 'P*' -Repository MyRepo

Find-PSResource: Searching through ADOFeed with wildcard in Name is not supported, so PSStenaNew repository will be skipped.



### Error details

```console
Get-Error -Newest 3   


   ErrorIndex: 0

Exception             : 
    Type    : System.ArgumentException
    Message : Searching through ADOFeed with wildcard in Name is not supported, so PSStenaNew repository will be skipped.
    HResult : -2147024809
TargetObject          : Microsoft.PowerShell.PowerShellGet.Cmdlets.FindHelper
CategoryInfo          : InvalidArgument: (Microsoft.PowerShel….Cmdlets.FindHelper:FindHelper) [Find-PSResource], ArgumentException
FullyQualifiedErrorId : CannotSearchADOFeedWithWildcardName,Microsoft.PowerShell.PowerShellGet.Cmdlets.FindPSResource
InvocationInfo        : 
    MyCommand        : Find-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 3
    Line             : Find-PSResource -Name 'P*' -Repository PSStenaNew
    PositionMessage  : At line:1 char:1
                       + Find-PSResource -Name 'P*' -Repository PSStenaNew
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Find-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : 




   ErrorIndex: 1

Exception             : 
    Type        : System.Management.Automation.PSInvalidOperationException
    ErrorRecord : 
        Exception             : 
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : -Name '*' is not supported for Find-PSResource so all Name entries will be discarded.
            HResult : -2146233087
        CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : InvalidOperation
    Message     : -Name '*' is not supported for Find-PSResource so all Name entries will be discarded.
    HResult     : -2146233079
TargetObject          : Microsoft.PowerShell.PowerShellGet.Cmdlets.FindPSResource
CategoryInfo          : InvalidArgument: (Microsoft.PowerShel…lets.FindPSResource:FindPSResource) [Find-PSResource], PSInvalidOperationException
FullyQualifiedErrorId : NameEqualsWildcardIsNotSupported,Microsoft.PowerShell.PowerShellGet.Cmdlets.FindPSResource
InvocationInfo        : 
    MyCommand        : Find-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 2
    Line             : Find-PSResource -Name '*' -Repository PSStenaNew
    PositionMessage  : At line:1 char:1
                       + Find-PSResource -Name '*' -Repository PSStenaNew
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Find-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : 




   ErrorIndex: 2

Exception             : 
    Type        : System.Management.Automation.PSInvalidOperationException
    ErrorRecord : 
        Exception             : 
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : Name parameter must be provided.
            HResult : -2146233087
        CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : InvalidOperation
    TargetSite  : 
        Name          : ThrowTerminatingError
        DeclaringType : System.Management.Automation.MshCommandRuntime, System.Management.Automation, Version=7.2.0.9, Culture=neutral, PublicKeyToken=31bf3856ad364e35
        MemberType    : Method
        Module        : System.Management.Automation.dll
    Message     : Name parameter must be provided.
    Source      : System.Management.Automation
    HResult     : -2146233079
    StackTrace  : 
   at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) in System.Management.Automation.dll:token 0x6002d2b+0x6
TargetObject          : Microsoft.PowerShell.PowerShellGet.Cmdlets.FindPSResource
CategoryInfo          : InvalidOperation: (Microsoft.PowerShel…lets.FindPSResource:FindPSResource) [Find-PSResource], PSInvalidOperationException
FullyQualifiedErrorId : NameParameterNotProvided,Microsoft.PowerShell.PowerShellGet.Cmdlets.FindPSResource
InvocationInfo        : 
    MyCommand        : Find-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 1
    Line             : Find-PSResource -Repository PSStenaNew
    PositionMessage  : At line:1 char:1
                       + Find-PSResource -Repository PSStenaNew
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Find-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
Environment data
Get-Module PowerShellGet; $PSVersionTable


ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     3.0.11     beta       PowerShellGet                       {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Install-PSResource…}

Key   : PSVersion
Value : 7.2.0-preview.9
Name  : PSVersion


Key   : PSEdition
Value : Core
Name  : PSEdition


Key   : GitCommitId
Value : 7.2.0-preview.9
Name  : GitCommitId


Key   : OS
Value : Microsoft Windows 10.0.19043
Name  : OS


Key   : Platform
Value : Win32NT
Name  : Platform


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name  : PSCompatibleVersions


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion
Visuals

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Problem mit Find-PSResource gegen ein Azure Artifacts v2-Repository zu reproduzieren, wobei kein Name und Wildcard-Namen wie gezeigt verwendet werden. Verfolge die Verarbeitung von Find-PSResource für ADOFeed und seine Fehler NameParameterNotProvided, NameEqualsWildcardIsNotSupported und CannotSearchADOFeedWithWildcardName; abgeschlossen ist die Aufgabe, wenn verfügbare Module wie erwartet aufgelistet oder nach Wildcard gefiltert werden können, ohne dass diese Fehler auftreten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, powershell
Bereich
cli, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.