Skip to content

[Get-InstalledPSResource] Using '-Scope "AllUsers"' triggers an exception #1812

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

Open
3 tasks done
PFierlafijn opened this issue Apr 1, 2025 · 0 comments
Open
3 tasks done
Labels
Area-GetPSResource Issue-Bug Something isn't working

Comments

@PFierlafijn
Copy link

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 experience an issue with Get-InstalledPSResource. When used with the Scope parameter with value AllUsers an exception is returned.

Expected behavior

PS> Get-InstalledPSResource -Scope AllUsers
Name                                         Version    Prerelease Repository   Description
----                                         -------    ---------- ----------   -----------
CompletionPredictor                          0.1.1                 PSGallery    Command-line intellisense based on PowerShell auto-completion
Microsoft.Graph.Authentication               2.26.1                PSGallery    Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.CloudCommunications          2.26.1                PSGallery    Microsoft Graph PowerShell Cmdlets
Microsoft.Graph.Identity.DirectoryManagement 2.26.1                PSGallery    Microsoft Graph PowerShell Cmdlets
...

Actual behavior

PS> Get-InstalledPSResource -Scope AllUsers
Get-InstalledPSResource: No match was found for package '*'.

Error details

Exception             : 
    Type    : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
    Message : No match was found for package '*'.
    HResult : -2146233088
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.GetInstalledPSResourceCommand
CategoryInfo          : ObjectNotFound: (Microsoft.PowerSheledPSResourceCommand:GetInstalledPSResourceCommand) [Get-InstalledPSResource], ResourceNotFoundException
FullyQualifiedErrorId : InstalledPackageNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.GetInstalledPSResourceCommand
InvocationInfo        : 
    MyCommand        : Get-InstalledPSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 16
    Line             : Get-InstalledPSResource -Scope AllUsers
    Statement        : Get-InstalledPSResource -Scope AllUsers
    PositionMessage  : At line:1 char:1
                       + Get-InstalledPSResource -Scope AllUsers
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Get-InstalledPSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : 
      0
      1

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.1.1                 Microsoft.PowerShell.PSResourceGet  {Compress-PSResource, Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository…} 


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

No branches or pull requests

2 participants