added check for project name being set

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-14 14:45:53 +02:00
parent 3dfa7a0e58
commit 81dba8289b

View File

@ -12,6 +12,7 @@ $ret
$acl $acl
$r $r
if($PSBoundParameters.ContainsKey($ProjectName)){
if($PSBoundParameters.ContainsKey("Server")){ if($PSBoundParameters.ContainsKey("Server")){
$ret = New-ADGroup -Path $Projects -Server $Server -Name $ProjectName -GroupCategory Security -GroupScope Global $ret = New-ADGroup -Path $Projects -Server $Server -Name $ProjectName -GroupCategory Security -GroupScope Global
$acl = . .\AddProjectACL.ps1 -ProjectName $ProjectName -Server $Server $acl = . .\AddProjectACL.ps1 -ProjectName $ProjectName -Server $Server
@ -30,4 +31,7 @@ if($PSBoundParameters.ContainsKey("Server")){
} }
return $ret return $ret
}
throw "ProjectName parameter needs to be set"