20 lines
468 B
PowerShell
20 lines
468 B
PowerShell
# Parameter help description
|
|
[CmdletBinding()]
|
|
param (
|
|
[string]
|
|
$Name,
|
|
[string]
|
|
$Server
|
|
)
|
|
|
|
if($PSBoundParameters.ContainsKey('Name')){
|
|
$Roles
|
|
if($PSBoundParameters.ContainsKey('Server')){
|
|
$Roles = . .\GetRoles.ps1 -Server $Server | Where-Object Name -Match $Name
|
|
} else {
|
|
$Roles = . .\GetRoles.ps1 | Where-Object Name -Match $Name
|
|
}
|
|
return $Roles | Get-ADGroupMember | Get-Unique
|
|
}
|
|
|
|
throw "No such Project was found" |