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

Install-PSResource doesn't find version for Microsoft.Graph.Users on local Reporsitory when Microsoft.Graph.Users.Actions is present #1648

Open
3 tasks done
FierlaPi opened this issue May 2, 2024 · 0 comments
Assignees
Labels
Area-Install Issue-Bug Something isn't working

Comments

@FierlaPi
Copy link

FierlaPi commented May 2, 2024

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

I'm experiencing a problem with Install-PSResource and Find-PSResource when installing Microsoft.Graph.Users (currently version 2.18.0) when Microsoft.Graph.Users.Actions is also present in de repo.

The setup is done as follows:

Created a local file repository with the snippet:

Register-PSResourceRepository -Name 'Repo' -Uri \\server\Repo -Trusted -Priority 1

Save the Microsoft.Graph.Users and Microsoft.Graph.Users.Actions with snippet:

Save-PSResource -Name Microsoft.Graph.Users.Actions -Repository PSGallery -TrustRepository -Path \\server\Repo -AsNupkg
Save-PSResource -Name Microsoft.Graph.Users -Repository PSGallery -TrustRepository -Path \\server\Repo -AsNupkg

Expected behavior

PS> Install-PSResource Microsoft.Graph.Users -Repository Repo
PS> Find-PSResource Microsoft.Graph.Users

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
Microsoft.Graph.Users 2.18.0             Repo       Microsoft Graph PowerShell Cmdlets
Microsoft.Graph.Users 2.18.0             PSGallery  Microsoft Graph PowerShell Cmdlets

Actual behavior

PS> Install-PSResource Microsoft.Graph.Users -Repository Repo
Install-PSResource: Could not parse version actions.2.18.0 from file Microsoft.Graph.Users.Actions.2.18.0.nupkg
Install-PSResource: Package(s) 'Microsoft.Graph.Users' could not be installed from repository 'Repo'.

PS> Find-PSResource Microsoft.Graph.Users

Name                  Version Prerelease Repository Description
----                  ------- ---------- ---------- -----------
Microsoft.Graph.Users 2.18.0             PSGallery  Microsoft Graph PowerShell Cmdlets

Error details

PS> Get-Error 

Exception             : 
    Type    : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
    Message : Package(s) 'Microsoft.Graph.Users' could not be installed from repository 'Repo'.
    HResult : -2146233088
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource
CategoryInfo          : InvalidData: (Microsoft.PowerShel…s.InstallPSResource:InstallPSResource) [Install-PSResource], ResourceNotFoundException
FullyQualifiedErrorId : InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource
InvocationInfo        : 
    MyCommand        : Install-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 65
    Line             : Install-PSResource Microsoft.Graph.Users -Repository Repo
    Statement        : Install-PSResource Microsoft.Graph.Users -Repository Repo
    PositionMessage  : At line:1 char:1
                       + Install-PSResource Microsoft.Graph.Users -Repository Repo
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Install-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : 
      0
      1

Environment data

PS> Get-Module Microsoft.PowerShell.PSResourceGet; $PSVersionTable | Format-Table

Name                               Version PreRelease ExportedCommands
----                               ------- ---------- ----------------
Microsoft.PowerShell.PSResourceGet 1.0.4.1            {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Get-PSScriptFileInfo…}


Name                      Value
----                      -----
PSVersion                 7.4.2
PSEdition                 Core
GitCommitId               7.4.2
OS                        Microsoft Windows 10.0.19045
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-Install Issue-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants