diff --git a/AddUser.ps1 b/AddUser.ps1 index cbf759b..6a7cca4 100644 --- a/AddUser.ps1 +++ b/AddUser.ps1 @@ -11,8 +11,8 @@ param ( $Type = "RO" ) -$User = $null -$Group = $null +[ADUser]$User = $null +[ADGroup]$Group = $null if(!$PSBoundParameters.ContainsKey("ProjectName")){ @@ -50,9 +50,9 @@ if($null -eq $Group){ $targeGroup =$null if($PSBoundParameters.ContainsKey("Server")){ - $targeGroup = . .\GetRoles.ps1 -Server $Server -ProjectName $ProjectName + $targeGroup = . .\GetRoles.ps1 -Server $Server -ProjectName $ProjectName | Where-Object Name -Match $Type } else { - $targeGroup = . .\GetRoles.ps1 -ProjectName $ProjectName + $targeGroup = . .\GetRoles.ps1 -ProjectName $ProjectName | Where-Object Name -Match $Type } if($null -eq $Group){