added check for project name being set
This commit is contained in:
parent
239c66befc
commit
b68961cb95
@ -13,12 +13,16 @@ $Write = 'GR-'+$ProjectName+'-RW'
|
|||||||
|
|
||||||
$ret=@()
|
$ret=@()
|
||||||
|
|
||||||
if($PSBoundParameters.ContainsKey("Server")){
|
if($PSBoundParameters.ContainsKey("ProjectName")){
|
||||||
|
if($PSBoundParameters.ContainsKey("Server")){
|
||||||
$ret += New-ADGroup -Path $Roles -Server $Server -Name $Read -GroupCategory Security -GroupScope Global
|
$ret += New-ADGroup -Path $Roles -Server $Server -Name $Read -GroupCategory Security -GroupScope Global
|
||||||
$ret += New-ADGroup -Path $Roles -Server $Server -Name $Write -GroupCategory Security -GroupScope Global
|
$ret += New-ADGroup -Path $Roles -Server $Server -Name $Write -GroupCategory Security -GroupScope Global
|
||||||
} else {
|
} else {
|
||||||
$ret += New-ADGroup -Path $Roles -Name $Read -GroupCategory Security -GroupScope Global
|
$ret += New-ADGroup -Path $Roles -Name $Read -GroupCategory Security -GroupScope Global
|
||||||
$ret += New-ADGroup -Path $Roles -Name $Write -GroupCategory Security -GroupScope Global
|
$ret += New-ADGroup -Path $Roles -Name $Write -GroupCategory Security -GroupScope Global
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret
|
throw "ProjectName parameter needs to be set"
|
Loading…
Reference in New Issue
Block a user