0

I'm currently to get the quota details using the following powershell command.

get-fsrmquota -Path "C:Temp\ID\1500-1"

This works great. I'm trying to get a wildcard path to look for all the IDs that have a ID of 1500. I tried the following sets of commands but they return error

get-fsrmquota -Path "C:Temp\ID\1500-*"
get-fsrmquota -Path "C:Temp\ID\1500-?"
get-fsrmquota -Path "C:Temp\ID\*1500-"
get-fsrmquota -Path "C:Temp\ID\?1500-"

The error that I get is the following,

0x80045306, The specified path is invalid

I have got another way but it loops through all the folders and then filters the folders out, which takes the same time as looping through all the folder.

get-fsrmquota -Path "C:Temp\ID\..." | Where-Object {$_.Path - Like "C:Temp\ID\1500-*"}

I'm looking for another way to get the folder details for the same Id.

Any help would be greatly appreciated.

Thanks.

Peter Channon
  • 131
  • 4
  • 16

1 Answers1

0

Get-Help on Get-FsrmQuota says:

-Path

Specifies the local folder that contains the quota.

This parameter supports recursive and wildcard paths. To specify a recursive path, add ... to a path. For example, C:\ Share01... indicates all of the quotas in C:\ Share1 plus all the quotas in any and all subfolders of C:\ Share01. To specify a wildcard in a path, you can add the asterisk (*) and the question mark (?) to a path. For example, C:\ Share01*A indicates all of the quotas in C:\ Share01 plus all the quotas in subfolders of C:\ Share01 that have a name that begins with the letter A.

So I'd expect

get-fsrmquota -Path 'C:\Temp\ID\1500-*'

should work.

mjolinor
  • 66,130
  • 7
  • 114
  • 135