diff --git a/GetACLs.ps1 b/GetACLs.ps1 index 25aad83..77eedd7 100644 --- a/GetACLs.ps1 +++ b/GetACLs.ps1 @@ -15,6 +15,9 @@ if($PSBoundParameters.ContainsKey("Server")){ if($PSBoundParameters.ContainsKey("ProjectName")){ $Projects = $Projects | Where-Object Name -Match $ProjectName + if($ProjectName.Count -ge 1){ + $Projects=$Projects[0] + } } return $Projects | Get-ADGroupMember | Where-Object Name -Match "ACL.*" \ No newline at end of file diff --git a/GetRoles.ps1 b/GetRoles.ps1 index 6c8bb2f..972611b 100644 --- a/GetRoles.ps1 +++ b/GetRoles.ps1 @@ -7,14 +7,24 @@ param ( ) $Projects=$null -if($PSBoundParameters.ContainsKey("Server")){ - $Projects = . .\GetProjects.ps1 -Server $Server -} else { - $Projects = . .\GetProjects.ps1 +if($PSBoundParameters.ContainsKey("ProjectName")){ + if($PSBoundParameters.ContainsKey("Server")){ + $Projects = . .\GetProjects.ps1 -Server $Server + } else { + $Projects = . .\GetProjects.ps1 + } +} else{ + if($PSBoundParameters.ContainsKey("Server")){ + $Projects = . .\GetProjects.ps1 -Server $Server + } else { + $Projects = . .\GetProjects.ps1 + } } - if($PSBoundParameters.ContainsKey("ProjectName")){ $Projects = $Projects | Where-Object Name -Match $ProjectName + if($ProjectName.Count -ge 1){ + $Projects=$Projects[0] + } } return $Projects | Get-ADGroupMember | Where-Object Name -Match "GR.*" \ No newline at end of file