PowerShell / PowerShell/PSResourceGet
Request for `Find-PSResource *` on GitHub packages
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 576
- Forks
- 114
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 7
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:
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:
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing Find-PSResource -Name * against the GitHub repository with the supplied credentials, then trace the Find-PSResource handling for V3 repositories. Compare it with the more specific wildcard case; done means the broad wildcard lists all modules and scripts from the repository without the FindAllFail error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github, powershell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100