-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified uneccessary mandatory parameters
- Loading branch information
Showing
1 changed file
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ | |
.PARAMETER Zones | ||
PSCustomObject(s) with properties for a Cloud Zone | ||
.PARAMETER Viewers | ||
Viewers to add to the Project | ||
.PARAMETER Members | ||
Members to add to the Project | ||
|
@@ -52,6 +55,7 @@ | |
Name = 'Test Project' | ||
Description = 'Test Project' | ||
Zones = $CloudZone | ||
Viewers = '[email protected]' | ||
Members = '[email protected]','[email protected]' | ||
Administrators = '[email protected]','[email protected]' | ||
OperationTimeout = 3600 | ||
|
@@ -115,10 +119,14 @@ | |
[ValidateNotNullOrEmpty()] | ||
[String]$Description, | ||
|
||
[Parameter(Mandatory=$true,ParameterSetName="Standard")] | ||
[Parameter(Mandatory=$false,ParameterSetName="Standard")] | ||
[ValidateNotNullOrEmpty()] | ||
[PSCustomObject[]]$Zones, | ||
|
||
[Parameter(Mandatory=$false,ParameterSetName="Standard")] | ||
[ValidateNotNullOrEmpty()] | ||
[String[]]$Viewers, | ||
|
||
[Parameter(Mandatory=$false,ParameterSetName="Standard")] | ||
[ValidateNotNullOrEmpty()] | ||
[String[]]$Members, | ||
|
@@ -127,7 +135,7 @@ | |
[ValidateNotNullOrEmpty()] | ||
[String[]]$Administrators, | ||
|
||
[Parameter(Mandatory=$true,ParameterSetName="Standard")] | ||
[Parameter(Mandatory=$false,ParameterSetName="Standard")] | ||
[ValidateNotNullOrEmpty()] | ||
[Int]$OperationTimeout, | ||
|
||
|
@@ -169,6 +177,7 @@ | |
"name": "$($Name)", | ||
"description": "$($Description)", | ||
"zoneAssignmentConfigurations": [], | ||
"viewers": [], | ||
"members": [], | ||
"administrators": [], | ||
"operationTimeout": $($OperationTimeout), | ||
|
@@ -184,6 +193,21 @@ | |
$JSONObject.zoneAssignmentConfigurations += $Zone | ||
} | ||
|
||
# --- Add Viewers | ||
if ($PSBoundParameters.ContainsKey("Viewers")){ | ||
|
||
foreach ($Viewer in $Viewers){ | ||
|
||
$Addition = @" | ||
{ | ||
"email": "$($Viewer)" | ||
} | ||
"@ | ||
$AdditionObject = $Addition | ConvertFrom-Json | ||
$JSONObject.viewers += $AdditionObject | ||
} | ||
} | ||
|
||
# --- Add Members | ||
if ($PSBoundParameters.ContainsKey("Members")){ | ||
|
||
|