Skip to content

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

Open
@PFierlafijn

Description

@PFierlafijn

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions