Skip to content

Request for Find-PSResource * on GitHub packages #1205

Open

Description

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

So, I would say that this is very similar in nature to issue #520. but it appears that the behavior of psresourceget has changed since this issue was posted 2 years ago, so I figured I would submit this issue with the updated problems. I am using github packages to host several powershell modules, and I have noticed that find-psresource behaves in a very inconsistent manner. When you attempt to run the below powershell command:

Find-psresource -Name * -Credential $CRED -Repository github

You see the below error message:

image

However, if the wildcard is part of a string, then psresourceget has no problem searching for and returning multiple modules that match that more specific string. So, for example, when I run the below command:

find-psresource -Name *oseries* -Credential $CRED -Repository github

This is the return:

image

There is absolutely no reason why the first command should fail if the second runs just fine.

Expected behavior

Find-psresource -Name * -Credential $CRED -Repository github

## List all modules/scripts published to the specified repository

Actual behavior

find-psresource -Name * -Credential $CRED -Repository github
Find-PSResource: Find all is not supported for the V3 repository Github

Error details

Get-error

Exception             :
    Type    : System.InvalidOperationException
    Message : Find all is not supported for the V3 repository Github
    HResult : -2146233079
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.FindHelper
CategoryInfo          : InvalidOperation: (Microsoft.PowerShel….Cmdlets.FindHelper:FindHelper) [Find-PSResource],
InvalidOperationException
FullyQualifiedErrorId : FindAllFail,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource
InvocationInfo        :
    MyCommand        : Find-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 5
    Line             : find-psresource -Name * -Credential $CRED -Repository github
    PositionMessage  : At line:1 char:1
                       + find-psresource -Name * -Credential $CRED -Repository github
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : find-psresource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :

Environment data

PS> Get-Module microsoft.powershell.PSResourceGet; $PSVersionTable | format-table

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     0.5.22     beta22     Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PSReso…


Name                           Value
----                           -----
PSVersion                      7.3.4
PSEdition                      Core
GitCommitId                    7.3.4
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Activity

  1. changed the title [-]Running Find-psresource with custom repository inconsistency[/-] [+]Request for `Find-PSResource *` on GitHub packages[/+] on Jun 29, 2023
  2. SydneyhSmith commented on Jun 29, 2023

    @SydneyhSmith
    Collaborator

    Thanks for opening this issue William Higgs (@youngturk2)

    We initially made this decision because of limitations that make this type of search "find all" not possible for nuget gallery and azure dev ops, due to factors like it being an expensive call, api support, and potential calls to upstream sources...however we already special case GitHub packages in these calls so we could enable find all for GH packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions