Skip to content

Commit

Permalink
Search-TssFolder - PermissionRequired param allow multiple
Browse files Browse the repository at this point in the history
Can filter on multiple permissions for a folder
  • Loading branch information
wsmelton committed Jun 19, 2021
1 parent ad78a12 commit 876ba0f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/functions/folders/Search-Folder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Search-Folder {

# Filter based on folder permission (Owner, Edit, AddSecret, View). Default: View
[ValidateSet('Owner', 'Edit', 'AddSecret', 'View')]
[string]
[string[]]
$PermissionRequired,

# Sort by specific property, default FolderPath
Expand All @@ -67,8 +67,10 @@ function Search-Folder {
if ($tssParams.ContainsKey('SearchText')) {
$filters += "filter.searchText=$SearchText"
}
if ($tssParams.ContainsKey('Permission')) {
$filters += "filter.permissionRequired=$PermissionRequired"
if ($tssParams.ContainsKey('PermissionRequired')) {
foreach ($perm in $PermissionRequired) {
$filters += "filter.permissionRequired=$perm"
}
}
if ($filters) {
$uriFilter = $filters -join '&'
Expand Down

0 comments on commit 876ba0f

Please sign in to comment.