Skip to content
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

Save-PSResource -AsNupkg causes pipeline input to fail #948

Open
3 tasks done
ThomasNieto opened this issue Feb 13, 2023 · 0 comments
Open
3 tasks done

Save-PSResource -AsNupkg causes pipeline input to fail #948

ThomasNieto opened this issue Feb 13, 2023 · 0 comments
Labels
Area-Save Issue-Bug Something isn't working

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

Using -AsNupkg causes pipeline input to fail. Notice the error message name for the resource is the type name not resource.

Find-PSResource snmp | Save-PSResource -Path c:\temp -AsNupkg -TrustRepository -PassThru

Expected behavior

# works

Actual behavior

Find-PSResource snmp | Save-PSResource -Path c:\temp -AsNupkg -TrustRepository -PassThru
Save-PSResource: Package 'Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo' with requested version range '(, )' could not be found in any trusted repositories

Error details

Exception             :
    Type    : System.ArgumentException
    Message : Package 'Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo' with requested version range '(,
)' could not be found in any trusted repositories
    HResult : -2147024809
CategoryInfo          : ObjectNotFound: (:) [Save-PSResource], ArgumentException
FullyQualifiedErrorId : ResourceNotFoundError,Microsoft.PowerShell.PowerShellGet.Cmdlets.SavePSResource
InvocationInfo        :
    MyCommand        : Save-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 24
    HistoryId        : 13
    Line             : Find-PSResource snmp | Save-PSResource -Path c:\temp -AsNupkg -TrustRepository -PassThru
    PositionMessage  : At line:1 char:24
                       + … urce snmp | Save-PSResource -Path c:\temp -AsNupkg -TrustRepository - …
                       +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Save-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :

Environment data

3.0.19

Name                           Value
----                           -----
PSVersion                      7.3.2
PSEdition                      Core
GitCommitId                    7.3.2
OS                             Microsoft Windows 10.0.19044
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
Labels
Area-Save Issue-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants