PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

[Find-PSResource]Using wildcard with Repository parameter causes error 'ErrorFilteringNamesForUnsupportedWildcards'

Open LaurentDardenne opened this issue 1 year ago • 5 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest released version
  • [X] Search the existing issues.

Steps to reproduce

The documentation for Find-PSResource indicates that the Repository parameter accepts wildcards, its use causes an error.

Find-PSResource -Name 'invokebuild'  -Prerelease -Repository '[PS*]'

But the error message quotes the parameter Name :

Find-PSResource : -Name with wildcards '?' and '[' are not supported for this cmdlet so Name entry: [PS*] will be
discarded.

Expected behavior

List all module matching.

Actual behavior

Error 'ErrorFilteringNamesForUnsupportedWildcards'.

Error details

$error[0]|select *


writeErrorStream      : True
PSMessageDetails      :
Exception             : System.Management.Automation.PSInvalidOperationException: -Name with wildcards '?' and '[' are
                        not supported for this cmdlet so Name entry: [PS*] will be discarded.
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.FindHelper
CategoryInfo          : InvalidArgument : (Microsoft.Power...lets.FindHelper:FindHelper) [Find-PSResource],
                        PSInvalidOperationException
FullyQualifiedErrorId : ErrorFilteringNamesForUnsupportedWildcards,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSRes
                        ource
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : à <ScriptBlock>, <Aucun fichier> : ligne 1
PipelineIterationInfo : {0, 1}

Environment data

#Obsolete comment :"Paste verbatim output from Get-Module PSResourceGet; $PSVersionTable below."


Get-Module Microsoft.PowerShell.PSResourceGet

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     0.5.22     Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PSResourceR...


$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.3031
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.3031}
BuildVersion                   10.0.19041.3031
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Visuals

image

LaurentDardenne avatar Jul 25 '23 13:07 LaurentDardenne