Skip to content

Untrusted repository unexpected error when declining to continue #687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
ThomasNieto opened this issue Jul 4, 2022 · 0 comments · Fixed by #712
Closed
3 tasks done

Untrusted repository unexpected error when declining to continue #687

ThomasNieto opened this issue Jul 4, 2022 · 0 comments · Fixed by #712

Comments

@ThomasNieto
Copy link
Contributor

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

If you decline to install a resource at the untrusted repository prompt it writes an error about not finding the resource in any repository.

The message also has a few typos with a space between repository name, PSrepository to PSRepository, and modules should be changed to resources.

https://github.com/PowerShell/PowerShellGet/blob/c535ca78cdc0b68bb47d4a4c7052f8b627030c04/src/code/InstallHelper.cs#L39

You are installing the resources from an untrusted repository. If you trust this repository, change its Trusted value by running the Set-PSResourceRepository cmdlet. Are you sure you want to install the PSResource from '{0}'?

Expected behavior

No error is produced.

Actual behavior

PS C:\> Install-PSResource OperationValidation

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its Trusted value by
running the Set-PSResourceRepository cmdlet. Are you sure you want to install the PSresource from 'PSGallery' ?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"):
Install-PSResource: Package 'OperationValidation' with requested version range (, ) could not be installed as it was not found in any registered repositories

Error details

Exception             :
    Type    : System.ArgumentException
    Message : Package 'OperationValidation' with requested version range (, ) could not be installed as it was not
found in any registered repositories
    HResult : -2147024809
CategoryInfo          : ObjectNotFound: (:) [Install-PSResource], ArgumentException
FullyQualifiedErrorId : ResourceNotFoundError,Microsoft.PowerShell.PowerShellGet.Cmdlets.InstallPSResource
InvocationInfo        :
    MyCommand        : Install-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 1
    Line             : Install-PSResource OperationValidation
    PositionMessage  : At line:1 char:1
                       + Install-PSResource OperationValidation
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Install-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :

Environment data

Name          Version
----          -------
PowerShellGet 3.0.14

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.19043
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

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

Successfully merging a pull request may close this issue.

2 participants