2024-07-14 13:01:03 +02:00
|
|
|
[CmdletBinding()]
|
|
|
|
param (
|
|
|
|
[string]
|
2024-07-14 19:39:45 +02:00
|
|
|
$Server,
|
|
|
|
[string]
|
|
|
|
$ProjectName
|
2024-07-14 13:01:03 +02:00
|
|
|
)
|
2024-07-14 11:44:34 +02:00
|
|
|
|
2024-07-14 16:57:49 +02:00
|
|
|
$Projects=$null
|
2024-07-15 21:36:39 +02:00
|
|
|
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
|
|
|
|
}
|
2024-07-14 13:01:03 +02:00
|
|
|
}
|
2024-07-14 19:32:03 +02:00
|
|
|
if($PSBoundParameters.ContainsKey("ProjectName")){
|
|
|
|
$Projects = $Projects | Where-Object Name -Match $ProjectName
|
2024-07-15 21:36:39 +02:00
|
|
|
if($ProjectName.Count -ge 1){
|
|
|
|
$Projects=$Projects[0]
|
|
|
|
}
|
2024-07-14 19:32:03 +02:00
|
|
|
}
|
|
|
|
|
2024-07-14 14:56:34 +02:00
|
|
|
return $Projects | Get-ADGroupMember | Where-Object Name -Match "GR.*"
|