PowerShell / PowerShell/PSResourceGet

Registering ProGet feeds fails-- Unknown Repository Default is not Desirable

Open
#1,403 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-PSRepository Issue-Bug
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

We've been using ProGet with no issues with PowerShellGet for years ...

image

$ServerDomain = "ProGet"
$FeedName  = "PowerShell"

Register-PSResourceRepository -Name $ServerDomain -Uri https://$ServerDomain/nuget/$FeedName -Trusted -Force
Install-PSResource $ModuleName -Repository $ServerDomain
Install-PSResource: Repository 'ProGet' is not a known repository type that is supported. Please file an issue for support at https://github.com/PowerShell/PSResourceGet/issues
Important:

I was able to get it to work by simply editing $Home\AppData\Local\PSResourceGet\PSResourceRepository.xml and replacing "unknown" with "v2" -- this is purely a bug in Register-PSResourceRepository which I don't understand.

Expected behavior
Register-PSResourceRepository should _just work_
Actual behavior
Register-PSResourceRepository put `APIVersion="unknown"` in the `PSResourceRepository.xml` file
Error details
Exception             :
    Type    : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
    Message : Package 'LDGit' could not be found in any registered repositories.
    HResult : -2146233088
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.FindHelper
CategoryInfo          : ObjectNotFound: (Microsoft.PowerShel….Cmdlets.FindHelper:FindHelper) [Find-PSResource], ResourceNotFoundException
FullyQualifiedErrorId : PackageNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource
InvocationInfo        :
    MyCommand        : Find-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 19
    Line             : Find-PSResource LDGit -Verbose -Debug
    Statement        : Find-PSResource LDGit -Verbose -Debug
    PositionMessage  : At line:1 char:1
                       + Find-PSResource LDGit -Verbose -Debug
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Find-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     0.9.0      rc1        Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Get-PSScriptFileInfo…}


Name                           Value
----                           -----
PSVersion                      7.4.0-preview.5
PSEdition                      Core
GitCommitId                    7.4.0-preview.5
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with Register-PSResourceRepository against the ProGet NuGet feed, then inspect the generated PSResourceRepository.xml and compare the APIVersion value with the manually corrected "v2" value. Done means registration stores a supported API version and subsequent Find-PSResource or Install-PSResource calls work without editing the XML.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.