AzurePSDrive icon indicating copy to clipboard operation
AzurePSDrive copied to clipboard

dir -recurse throws InvalidFilterInQueryString error

Open HemantMahawar opened this issue 8 years ago • 0 comments

Steps to reproduce

  • Open PowerShell in Cloud Shell
  • cd to a resource group, e.g., Azure:<Subscription Name>\ResourceGroups<resource group name>
  • Try to filter for some name recursively, e.g: dir -Filter PSCloud -Recurse

PS Azure:\<Subscription Name>\ResourceGroups\<resource group name>> dir

    Directory: Azure:\<subscription name>\ResourceGroups\<resource group name>

Mode ProviderName
---- ------------
+    Microsoft.Automation
+    Microsoft.Compute
+    Microsoft.Network
+    Microsoft.Storage

PS Azure:\<Subscription Name>\ResourceGroups\<resource group name>> dir -Filter "*PSCloud*" -Recurse

Expected behavior

no error

Actual behavior

InvalidFilterInQueryString error

dir : InvalidFilterInQueryString : Invalid $filter '(resourceType EQ 'Microsoft.Automation/automationAccounts') AND
(substringof(Name, *PSCloud*.Replace('*', '')) eq true)' specified in the query string.
At line:1 char:1
+ dir -Filter  *PSCloud* -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (SHiPS:String) [Get-ChildItem], Exception
    + FullyQualifiedErrorId : InvalidFilterInQueryString,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet,Microsoft.PowerShell.Commands.GetChildItemCommand

Environment data


$env:ACC_VERSION:  master_20171021.1

Get-Module SHiPS

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.3.0      SHiPS

Get-Module AzurePSDrive

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.6.0      AzurePSDrive

HemantMahawar avatar Nov 02 '17 16:11 HemantMahawar