diff --git a/src/Functions/Public/properties-service/Get-vRAPropertyGroup.ps1 b/src/Functions/Public/properties-service/Get-vRAPropertyGroup.ps1 new file mode 100755 index 00000000..9ce1c96f --- /dev/null +++ b/src/Functions/Public/properties-service/Get-vRAPropertyGroup.ps1 @@ -0,0 +1,154 @@ +function Get-vRAPropertyGroup { +<# + .SYNOPSIS + Get a property group that the user is allowed to review. + + .DESCRIPTION + API for property groups that a system administrator can interact with. It allows the user to interact + with property groups that the user is permitted to review. + + .PARAMETER Id + The id of the property group + + .PARAMETER Limit + The number of entries returned per page from the API. This has a default value of 100 + + .PARAMETER Page + The index of the page to display. + + .INPUTS + System.String + System.Int + + .OUTPUTS + System.Management.Automation.PSObject + + .EXAMPLE + Get-vRAPropertyGroup + + .EXAMPLE + Get-vRAPropertyGroup -Limit 200 + + .EXAMPLE + Get-vRAPropertyGroup -Id Hostname + +#> +[CmdletBinding(DefaultParameterSetName="Standard")][OutputType('System.Management.Automation.PSObject')] + + Param ( + + [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName="ById")] + [ValidateNotNullOrEmpty()] + [String[]]$Id, + + [Parameter(Mandatory=$false,ParameterSetName="Standard")] + [ValidateNotNullOrEmpty()] + [Int]$Page = 1, + + [Parameter(Mandatory=$false,ParameterSetName="Standard")] + [ValidateNotNullOrEmpty()] + [Int]$Limit = 100 + + ) + + Begin { + # --- Test for vRA API version + xRequires -Version 7.0 + } + + Process { + + try { + + switch ($PsCmdlet.ParameterSetName) { + + # --- Get property Group by id + 'ById' { + + foreach ($PropertyGroupId in $Id) { + + $URI = "/properties-service/api/propertygroups/$($PropertyGroupId)" + + $PropertyGroup = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference + + $props = @{} + foreach($vRAProp in $PropertyGroup.properties.PSObject.Properties) { + $facets = @{} + foreach($facetkey in $vRAProp.Value.facets.PSObject.Properties) { + $facets.Add($facetkey.Name, $facetKey.Value.value.value) + } + + # add to props grouping now + $props.Add($vRAProp.Name, $facets) + } + + [PSCustomObject] @{ + + Id = $PropertyGroup.id + Label = $PropertyGroup.label + Description = $PropertyGroup.description + TenantId = $PropertyGroup.tenantId + DateCreated = $PropertyGroup.createdDate + LastUpdatedDate = $PropertyGroup.lastUpdated + Properties = $props + } + } + + break + + } + + # --- No parameters passed so return all property Groups + 'Standard' { + + $URI = "/properties-service/api/propertygroups?limit=$($Limit)&page=$($Page)&`$orderby=id asc" + + $EscapedURI = [uri]::EscapeUriString($URI) + + $Response = Invoke-vRARestMethod -Method GET -URI $EscapedURI -Verbose:$VerbosePreference + + foreach ($PropertyGroup in $Response.content) { + $props = @{} + foreach($vRAProp in $PropertyGroup.properties.PSObject.Properties) { + $facets = @{} + foreach($facetkey in $vRAProp.Value.facets.PSObject.Properties) { + $facets.Add($facetkey.Name, $facetKey.Value.value.value) + } + + # add to props grouping now + $props.Add($vRAProp.Name, $facets) + } + + [PSCustomObject] @{ + + Id = $PropertyGroup.id + Label = $PropertyGroup.label + Description = $PropertyGroup.description + TenantId = $PropertyGroup.tenantId + DateCreated = $PropertyGroup.createdDate + LastUpdatedDate = $PropertyGroup.lastUpdated + Properties = $props + } + + } + + Write-Verbose -Message "Total: $($Response.metadata.totalElements) | Page: $($Response.metadata.number) of $($Response.metadata.totalPages) | Size: $($Response.metadata.size)" + + break + + } + + } + + } + catch [Exception]{ + + throw + + } + } + + End { + + } +} \ No newline at end of file diff --git a/src/Functions/Public/properties-service/New-vRAPropertyGroup.ps1 b/src/Functions/Public/properties-service/New-vRAPropertyGroup.ps1 new file mode 100755 index 00000000..70c5fda1 --- /dev/null +++ b/src/Functions/Public/properties-service/New-vRAPropertyGroup.ps1 @@ -0,0 +1,208 @@ +function New-vRAPropertyGroup { + <# + .SYNOPSIS + Create a custom Property Group + + .DESCRIPTION + Create a custom Property Group + + .PARAMETER Name + The unique name (ID) of the Property + + .PARAMETER Label + The text to display in forms for the Property + + .PARAMETER Description + Description of the Property + + .PARAMETER Tenant + The tenant in which to create the Property Group (Defaults to the connection tenant ) + + .PARAMETER Properties + A hashtable representing the properties you would like to build into this new property group + + .PARAMETER JSON + Property Group to send in JSON format + + .INPUTS + System.String. + + .OUTPUTS + System.Management.Automation.PSObject + + .EXAMPLE + # Create a simple property group with no properties addded + New-vRAPropertyGroup -Name one + + .EXAMPLE + # Create a property group with a description and label + New-vRAPropertyGroup -Name OneWithDescription -Label "On With Description" -Description "This is one with a label and description" + + .EXAMPLE + # Create a property group with some properties added in simple form + New-vRAPropertyGroup -Name OneWithPropetiesSimple -Label "One With Properties" -Properties @{"com.org.bool"=$false; "com.org.string"="string1"} + + .EXAMPLE + # Create a property group with some properties added in the extended form + New-vRAPropertyGroup -Name OneWithPropertiesExt -Label "One With Properties" -Properties @{"com.org.bool"=@{"mandatory"=$true; "defaultValue"=$false;}; "com.org.encryptedandshowonform"=@{"encrypted"=$true; "visibility"=$true; "defaultValue"="Un-encrypted string";};} + +#> + [CmdletBinding(SupportsShouldProcess,ConfirmImpact = "Low",DefaultParameterSetName = 'Default')][OutputType('System.Management.Automation.PSObject')] + + Param ( + [parameter(Mandatory = $true, ParameterSetName = "Default")] + [ValidateNotNullOrEmpty()] + [String]$Name, + + [parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [String]$Label = $Name, + + [parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [String]$Description, + + [parameter(Mandatory = $false)] + [ValidateNotNullOrEmpty()] + [String]$Tenant = $Global:vRAConnection.Tenant, + + [parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "Properties")] + [ValidateNotNullOrEmpty()] + [hashtable]$Properties, + + [parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "JSON")] + [ValidateNotNullOrEmpty()] + [String]$JSON + + ) + + begin { + + # --- Test for vRA API version + xRequires -Version 7.0 + } + + process { + + try { + # --- Set Body for REST request depending on ParameterSet + if ($PSBoundParameters.ContainsKey("JSON")) { + $Body = $JSON + } + else { + $propertiesRaw = "" + + # process properties sent in + foreach ($propKey in $Properties.Keys) { + $prop = $Properties[$propKey] + switch ($prop.GetType()) { + "Hashtable" { + $facets = "" + foreach ($fKey in $prop.Keys) { + $f = $prop[$fKey] + switch ($fKey) { + "visibility" { + $facets += @" + "visibility": { + "type": "constant", + "value": { + "type": "boolean", + "value": $($f.toString().toLower()) + } + }, +"@ + } + "encrypted" { + $facets += @" + "encrypted": { + "type": "constant", + "value": { + "type": "boolean", + "value": $($f.toString().toLower()) + } + }, +"@ + } + "mandatory" { + $facets += @" + "mandatory": { + "type": "constant", + "value": { + "type": "boolean", + "value": $($f.toString().toLower()) + } + }, +"@ + } + "defaultValue" { + $facets += @" + "defaultValue": { + "type": "constant", + "value": { + "type": "string", + "value": "$($f)" + } + }, +"@ + } + } + } + $propertiesRaw += @" + "$($propKey)": { + "facets": { $($facets.Trim(',')) } + }, +"@ + break + } + default { + $propertiesRaw += @" + "$($propKey)": { + "facets": { + "defaultValue": { + "type": "constant", + "value": { + "type": "string", + "value": "$($prop)" + } + } + } + }, +"@ + break + } + } + } + # logic to build input + $Body = @" + { + "id" : "$($Name)", + "label" : "$($Label)", + "description" : "$($Description)", + "tenantId" : "$($Tenant)", + "version": 0, + "properties": { $($propertiesRaw.Trim(',')) } + } +"@ + } + + $URI = "/properties-service/api/propertygroups" + + Write-Verbose -Message "Preparing POST to $($URI)" + + Write-Verbose -Message "Posting Body: $($Body)" + + # --- Run vRA REST Request + if ($PSCmdlet.ShouldProcess($Id)) { + Invoke-vRARestMethod -Method POST -URI $URI -Body $Body | Out-Null + Get-vRAPropertyGroup -Id $Name + } + } + catch [Exception] { + + throw + } + } + end { + + } +} \ No newline at end of file diff --git a/src/Functions/Public/properties-service/Remove-vRAPropertyGroup.ps1 b/src/Functions/Public/properties-service/Remove-vRAPropertyGroup.ps1 new file mode 100755 index 00000000..8ebc52f1 --- /dev/null +++ b/src/Functions/Public/properties-service/Remove-vRAPropertyGroup.ps1 @@ -0,0 +1,85 @@ +function Remove-vRAPropertyGroup { +<# + .SYNOPSIS + Removes a Property Group from the specified tenant + + .DESCRIPTION + Uses the REST API to delete a property Group based on the Id supplied. If the Tenant is supplied it will delete the property group for that tenant only. + + .PARAMETER Id + The id of the property Group to delete + + .PARAMETER Tenant + The tenant of the property Group to delete + + .INPUTS + System.String + + .OUTPUTS + None + + .EXAMPLE + # Remove the property group "Hostname" + Remove-vRAPropertyGroup -Id Hostname + + .EXAMPLE + # Remove the property group "Hostname" using the pipeline + Get-vRAPropertyGroup -Id Hostname | Remove-vRAPropertyGroup -Confirm:$false + + .EXAMPLE + # Remove the property group "Hostname" from the tenant "Development" + Remove-vRAPropertyGroup -Id "Hostname" -Tenant Development + +#> +[CmdletBinding(SupportsShouldProcess,ConfirmImpact="High")] + + Param ( + + [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [String]$Id, + + [parameter(Mandatory=$false)] + [ValidateNotNullOrEmpty()] + [String]$Tenant + + ) + + Begin { + # --- Test for vRA API version + xRequires -Version 7.0 + } + + Process { + + try { + # Get-vRAPropertyGroup will throw a 404 error if it doesn't exist + if(Get-vRAPropertyGroup -Id $Id) { + + if ($PSCmdlet.ShouldProcess($Id)){ + + $URI = "/properties-service/api/propertygroups/$($Id)" + + if($Tenant) { + $URI += "?tenantId=$($Tenant)" + } + + $EscapedURI = [uri]::EscapeUriString($URI) + + Invoke-vRARestMethod -Method DELETE -URI $EscapedURI -Verbose:$VerbosePreference + } + + } + + } + catch [Exception]{ + + throw + + } + } + + End { + + } +} \ No newline at end of file diff --git a/src/PowervRA.psd1 b/src/PowervRA.psd1 index 39ed387d..5f9ffdb2 100644 --- a/src/PowervRA.psd1 +++ b/src/PowervRA.psd1 @@ -1,4 +1,4 @@ -# +# # Module manifest for module 'PowervRA' # # Generated by: Jakku Labs @@ -69,7 +69,7 @@ PowerShellVersion = '5.1' # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -FunctionsToExport = @('Add-vRACustomForm','Add-vRAPrincipalToTenantRole','Add-vRAReservationNetwork','Add-vRAReservationStorage','Connect-vRAServer','Disconnect-vRAServer','Export-vRAIcon','Export-vRAPackage','Get-vRAApplianceServiceStatus','Get-vRAAuthorizationRole','Get-vRABlueprint','Get-vRABusinessGroup','Get-vRACatalogItem','Get-vRACatalogItemRequestTemplate','Get-vRACatalogPrincipal','Get-vRAComponentRegistryService','Get-vRAComponentRegistryServiceEndpoint','Get-vRAComponentRegistryServiceStatus','Get-vRAContent','Get-vRAContentData','Get-vRAContentType','Get-vRACustomForm','Get-vRAEntitledCatalogItem','Get-vRAEntitledService','Get-vRAEntitlement','Get-vRAExternalNetworkProfile','Get-vRAGroupPrincipal','Get-vRAIcon','Get-vRANATNetworkProfile','Get-vRANetworkProfileIPAddressList','Get-vRANetworkProfileIPRangeSummary','Get-vRAPackage','Get-vRAPackageContent','Get-vRAPropertyDefinition','Get-vRARequest','Get-vRARequestDetail','Get-vRAReservation','Get-vRAReservationComputeResource','Get-vRAReservationComputeResourceMemory','Get-vRAReservationComputeResourceNetwork','Get-vRAReservationComputeResourceResourcePool','Get-vRAReservationComputeResourceStorage','Get-vRAReservationPolicy','Get-vRAReservationTemplate','Get-vRAReservationType','Get-vRAResource','Get-vRAResourceAction','Get-vRAResourceActionRequestTemplate','Get-vRAResourceMetric','Get-vRAResourceOperation','Get-vRAResourceType','Get-vRARoutedNetworkProfile','Get-vRAService','Get-vRAServiceBlueprint','Get-vRASourceMachine','Get-vRAStorageReservationPolicy','Get-vRATenant','Get-vRATenantDirectory','Get-vRATenantDirectoryStatus','Get-vRATenantRole','Get-vRAUserPrincipal','Get-vRAUserPrincipalGroupMembership','Get-vRAVersion','Import-vRAIcon','Import-vRAPackage','Invoke-vRADataCollection','Invoke-vRARestMethod','Invoke-vRATenantDirectorySync','New-vRABusinessGroup','New-vRAEntitlement','New-vRAExternalNetworkProfile','New-vRAGroupPrincipal','New-vRANATNetworkProfile','New-vRANetworkProfileIPRangeDefinition','New-vRAPackage','New-vRAPropertyDefinition','New-vRAReservation','New-vRAReservationNetworkDefinition','New-vRAReservationPolicy','New-vRAReservationStorageDefinition','New-vRARoutedNetworkProfile','New-vRAService','New-vRAStorageReservationPolicy','New-vRATenant','New-vRATenantDirectory','New-vRAUserPrincipal','Remove-vRABusinessGroup','Remove-vRACustomForm','Remove-vRAExternalNetworkProfile','Remove-vRAGroupPrincipal','Remove-vRAIcon','Remove-vRANATNetworkProfile','Remove-vRAPackage','Remove-vRAPrincipalFromTenantRole','Remove-vRAPropertyDefinition','Remove-vRAReservation','Remove-vRAReservationNetwork','Remove-vRAReservationPolicy','Remove-vRAReservationStorage','Remove-vRARoutedNetworkProfile','Remove-vRAService','Remove-vRAStorageReservationPolicy','Remove-vRATenant','Remove-vRATenantDirectory','Remove-vRAUserPrincipal','Request-vRACatalogItem','Request-vRAResourceAction','Set-vRABusinessGroup','Set-vRACatalogItem','Set-vRACustomForm','Set-vRAEntitlement','Set-vRAExternalNetworkProfile','Set-vRANATNetworkProfile','Set-vRAReservation','Set-vRAReservationNetwork','Set-vRAReservationPolicy','Set-vRAReservationStorage','Set-vRARoutedNetworkProfile','Set-vRAService','Set-vRAStorageReservationPolicy','Set-vRATenant','Set-vRATenantDirectory','Set-vRAUserPrincipal','Test-vRAPackage') +FunctionsToExport = @('Get-vRAServiceBlueprint','Export-vRAIcon','Get-vRACatalogItem','Get-vRACatalogItemRequestTemplate','Get-vRACatalogPrincipal','Get-vRAEntitledCatalogItem','Get-vRAEntitledService','Get-vRAEntitlement','Get-vRAIcon','Get-vRARequest','Get-vRARequestDetail','Get-vRAResource','Get-vRAResourceAction','Get-vRAResourceActionRequestTemplate','Get-vRAResourceOperation','Get-vRAResourceType','Get-vRAService','Import-vRAIcon','New-vRAEntitlement','New-vRAService','Remove-vRAIcon','Remove-vRAService','Request-vRACatalogItem','Request-vRAResourceAction','Set-vRACatalogItem','Set-vRAEntitlement','Set-vRAService','Get-vRAApplianceServiceStatus','Get-vRAComponentRegistryService','Get-vRAComponentRegistryServiceEndpoint','Get-vRAComponentRegistryServiceStatus','Add-vRACustomForm','Get-vRABlueprint','Get-vRACustomForm','Remove-vRACustomForm','Set-vRACustomForm','Connect-vRAServer','Export-vRAPackage','Get-vRAContent','Get-vRAContentData','Get-vRAContentType','Get-vRAPackage','Get-vRAPackageContent','Import-vRAPackage','New-vRAPackage','Remove-vRAPackage','Test-vRAPackage','Disconnect-vRAServer','Get-vRAExternalNetworkProfile','Get-vRANATNetworkProfile','Get-vRANetworkProfileIPAddressList','Get-vRANetworkProfileIPRangeSummary','Get-vRARoutedNetworkProfile','Get-vRASourceMachine','New-vRAExternalNetworkProfile','New-vRANATNetworkProfile','New-vRANetworkProfileIPRangeDefinition','New-vRARoutedNetworkProfile','Remove-vRAExternalNetworkProfile','Remove-vRANATNetworkProfile','Remove-vRARoutedNetworkProfile','Set-vRAExternalNetworkProfile','Set-vRANATNetworkProfile','Set-vRARoutedNetworkProfile','Add-vRAPrincipalToTenantRole','Get-vRAAuthorizationRole','Get-vRABusinessGroup','Get-vRAGroupPrincipal','Get-vRATenant','Get-vRATenantDirectory','Get-vRATenantDirectoryStatus','Get-vRATenantRole','Get-vRAUserPrincipal','Get-vRAUserPrincipalGroupMembership','Get-vRAVersion','Invoke-vRATenantDirectorySync','New-vRABusinessGroup','New-vRAGroupPrincipal','New-vRATenant','New-vRATenantDirectory','New-vRAUserPrincipal','Remove-vRABusinessGroup','Remove-vRAGroupPrincipal','Remove-vRAPrincipalFromTenantRole','Remove-vRATenant','Remove-vRATenantDirectory','Remove-vRAUserPrincipal','Set-vRABusinessGroup','Set-vRAStorageReservationPolicy','Set-vRATenant','Set-vRATenantDirectory','Set-vRAUserPrincipal','Invoke-vRARestMethod','Get-vRAResourceMetric','Invoke-vRADataCollection','Get-vRAPropertyDefinition','Get-vRAPropertyGroup','New-vRAPropertyDefinition','New-vRAPropertyGroup','Remove-vRAPropertyDefinition','Remove-vRAPropertyGroup','Add-vRAReservationNetwork','Add-vRAReservationStorage','Get-vRAReservation','Get-vRAReservationComputeResource','Get-vRAReservationComputeResourceMemory','Get-vRAReservationComputeResourceNetwork','Get-vRAReservationComputeResourceResourcePool','Get-vRAReservationComputeResourceStorage','Get-vRAReservationPolicy','Get-vRAReservationTemplate','Get-vRAReservationType','Get-vRAStorageReservationPolicy','New-vRAReservation','New-vRAReservationNetworkDefinition','New-vRAReservationPolicy','New-vRAReservationStorageDefinition','New-vRAStorageReservationPolicy','Remove-vRAReservation','Remove-vRAReservationNetwork','Remove-vRAReservationPolicy','Remove-vRAReservationStorage','Remove-vRAStorageReservationPolicy','Set-vRAReservation','Set-vRAReservationNetwork','Set-vRAReservationPolicy','Set-vRAReservationStorage') # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() diff --git a/tests/Test012-Properties-Service.Tests.ps1 b/tests/Test012-Properties-Service.Tests.ps1 index c5cb1f2c..ae20d4f0 100644 --- a/tests/Test012-Properties-Service.Tests.ps1 +++ b/tests/Test012-Properties-Service.Tests.ps1 @@ -31,6 +31,72 @@ Describe -Name 'Properties Service Tests' -Fixture { } $PropertyDefinitionD | Should Be $null } + + It -Name "Create a named Property Group $($JSON.PropetiesService.PropertyGroup.Name)" -Test { + $PropertiesHash = @{} + # Simple property + $PropertiesHash.Add("SimpleProperty", $JSON.PropertiesService.PropertyGroup.SimpleProperty) + # Complex Property + $ComplexProperty = @{} + + # Complex Property Values + $mandatory = $JSON.PropertiesService.PropertyGroup.ComplexProperty.mandatory + $encrypted = $JSON.PropertiesService.PropertyGroup.ComplexProperty.encrypted + $visibility = $JSON.PropertiesService.PropertyGroup.ComplexProperty.visibility + $defaultValue = $JSON.PropertiesService.PropertyGroup.ComplexProperty.defaultValue + + # build complex property + $ComplexProperty.Add("mandatory", $mandatory) + $ComplexProperty.Add("encrypted", $encrypted) + $ComplexProperty.Add("visibility", $visibility) + $ComplexProperty.Add("defaultValue", $defaultValue) + + # add complex property to hash + $PropertiesHash.Add("ComplexProperty", $ComplexProperty) + + $PropertyGroupA = New-vRAPropertyGroup -Name $JSON.PropertiesService.PropertyGroup.Name -Label $JSON.PropertiesService.PropertyGroup.Label ` + -Properties $PropertiesHash + $PropertyGroupA.Id | Should Be $JSON.PropertiesService.PropertyGroup.Name + $PropertyGroupA.Properties.Count | Should Be 2 + + # check simple property first + $PropertyGroupA.Properties.SimpleProperty.defaultValue | Should Be $JSON.PropertiesService.PropertyGroup.SimpleProperty + + # check complex property next + $PropertyGroupA.Properties.ComplexProperty.mandatory | Should Be $JSON.PropertiesService.PropertyGroup.ComplexProperty.mandatory + $PropertyGroupA.Properties.ComplexProperty.encrypted | Should Be $JSON.PropertiesService.PropertyGroup.ComplexProperty.encrypted + $PropertyGroupA.Properties.ComplexProperty.visibility | Should Be $JSON.PropertiesService.PropertyGroup.ComplexProperty.visibility + + # check defaultValue if unencrypted + if (-Not $PropertyGroupA.Properties.ComplexProperty.encrypted) { + $PropertyGroupA.Properties.ComplexProperty.defaultValue | Should Be $JSON.PropertiesService.PropertyGroup.ComplexProperty.defaultValue + } else { + # encrypted, so just check that value exists if value was passed + if (-Not [string]::IsNullOrEmpty($JSON.PropertiesService.PropertyGroup.ComplexProperty.defaultValue)) { + $PropertyGroupA.Properties.ComplexProperty.defaultValue | Should Not BeNullOrEmpty + } else { + $PropertyGroupA.Properties.ComplexProperty.defaultValue | Should BeNullOrEmpty + } + } + } + + It -Name "Return named Property Group $($JSON.PropertiesService.PropertyGroup.Name)" -Test { + + $PropertyGroupB = Get-vRAPropertyGroup -Id $JSON.PropertiesService.PropertyGroup.Name + $PropertygroupB.Id | Should Be $JSON.PropertiesService.PropertyGroup.Name + } + + It -Name "Remove named Property Group $($JSON.PropertiesService.PropertyGroup.Name)" -Test { + + Remove-vRAPropertyGroup -Id $JSON.PropertiesService.PropertyGroup.Name -Confirm:$false + try { + $PropertyGroupD = Get-vRAPropertyGroup -Id $JSON.PropertiesService.PropertyGroup.Name + } + catch [Exception]{ + + } + $PropertyGroupD | Should Be $null + } } # --- Cleanup diff --git a/tests/data/Variables.json b/tests/data/Variables.json index a10e903e..55601a30 100644 --- a/tests/data/Variables.json +++ b/tests/data/Variables.json @@ -141,6 +141,17 @@ "Name" : "PropertyDefinition01", "Label": "Check this box", "BooleanDisplay": "CHECKBOX" + }, + "PropertyGroup" : { + "Name" : "PropertyGroup1", + "Label" : "Test Property Group1", + "SimpleProperty": "Simple Value", + "ComplexProperty": { + "mandatory": true, + "encrypted": false, + "visibility": true, + "defaultValue": "Complex Value" + } } }, "Principal":