From 3f0cba6cd7dcc03c9a0642d3f3d9ff45312b616a Mon Sep 17 00:00:00 2001 From: Karl-Wilfried Zimmer Date: Mon, 15 Jul 2024 21:42:26 +0200 Subject: [PATCH] now searchin with eq --- GetACLs.ps1 | 5 +---- GetRoles.ps1 | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/GetACLs.ps1 b/GetACLs.ps1 index 77eedd7..e49eb33 100644 --- a/GetACLs.ps1 +++ b/GetACLs.ps1 @@ -14,10 +14,7 @@ if($PSBoundParameters.ContainsKey("Server")){ } if($PSBoundParameters.ContainsKey("ProjectName")){ - $Projects = $Projects | Where-Object Name -Match $ProjectName - if($ProjectName.Count -ge 1){ - $Projects=$Projects[0] - } + $Projects = $Projects | Where-Object Name -eq $ProjectName } return $Projects | Get-ADGroupMember | Where-Object Name -Match "ACL.*" \ No newline at end of file diff --git a/GetRoles.ps1 b/GetRoles.ps1 index 972611b..b607331 100644 --- a/GetRoles.ps1 +++ b/GetRoles.ps1 @@ -21,10 +21,7 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ } } if($PSBoundParameters.ContainsKey("ProjectName")){ - $Projects = $Projects | Where-Object Name -Match $ProjectName - if($ProjectName.Count -ge 1){ - $Projects=$Projects[0] - } + $Projects = $Projects | Where-Object Name -eq $ProjectName } return $Projects | Get-ADGroupMember | Where-Object Name -Match "GR.*" \ No newline at end of file