Fixed Compare Issues
Fixed issues with Compare and Settings Catalog
This commit is contained in:
@@ -1575,8 +1575,10 @@ function Compare-ObjectsBasedonDocumentation
|
|||||||
|
|
||||||
$addedProperties = @()
|
$addedProperties = @()
|
||||||
|
|
||||||
if($docObj1.InputType -eq "Settings")
|
if($docObj1.InputType -eq "Intent")
|
||||||
{
|
{
|
||||||
|
Set-ColumnVisibility $true ($null -ne ($docObj1.Settings | Where ParentSettingId -ne $null))
|
||||||
|
|
||||||
foreach ($prop in $docObj1.Settings)
|
foreach ($prop in $docObj1.Settings)
|
||||||
{
|
{
|
||||||
if(($prop.SettingId + $prop.ParentSettingId + $prop.RowIndex) -in $addedProperties) { continue }
|
if(($prop.SettingId + $prop.ParentSettingId + $prop.RowIndex) -in $addedProperties) { continue }
|
||||||
@@ -1650,8 +1652,48 @@ function Compare-ObjectsBasedonDocumentation
|
|||||||
Add-CompareProperty $prop.Name $val1 $val2 $prop.Category
|
Add-CompareProperty $prop.Name $val1 $val2 $prop.Category
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif($docObj1.InputType -eq "Settings")
|
||||||
|
{
|
||||||
|
Set-ColumnVisibility $true ($null -ne ($docObj1.Settings | Where SubCategory -ne $null))
|
||||||
|
|
||||||
|
foreach ($prop in $docObj1.Settings)
|
||||||
|
{
|
||||||
|
if(($prop.SettingId + $prop.CategoryId + $prop.SubCategoryDefinition.Id) -in $addedProperties) { continue }
|
||||||
|
|
||||||
|
$addedProperties += ($prop.SettingId + $prop.CategoryId + $prop.SubCategoryDefinition.Id)
|
||||||
|
$val1 = $prop.$settingsValue
|
||||||
|
$prop2 = $docObj2.Settings | Where { $_.SettingId -eq $prop.SettingId -and $_.CategoryId -eq $prop.CategoryId -and $_.SubCategoryDefinition.Id -eq $prop.SubCategoryDefinition.Id }
|
||||||
|
$val2 = $prop2.$settingsValue
|
||||||
|
if($val1 -isnot [array] -and $val2 -is [array] -and $val2.Count -gt 1)
|
||||||
|
{
|
||||||
|
Write-Log "Multiple compare results returend for $($prop.Name). Using first result" 2
|
||||||
|
$val2 = $val2[0]
|
||||||
|
}
|
||||||
|
Add-CompareProperty $prop.Name $val1 $val2 $prop.Category $prop.SubCategory
|
||||||
|
}
|
||||||
|
|
||||||
|
# These objects are defined only on Object 2. They will be last in the table
|
||||||
|
foreach ($prop in $docObj2.Settings)
|
||||||
|
{
|
||||||
|
if(($prop.SettingId + $prop.CategoryId + $prop.SubCategoryDefinition.Id) -in $addedProperties) { continue }
|
||||||
|
|
||||||
|
$addedProperties += ($prop.SettingId + $prop.CategoryId + $prop.SubCategoryDefinition.Id)
|
||||||
|
$val2 = $prop.$settingsValue
|
||||||
|
$prop2 = $docObj1.Settings | Where { $_.SettingId -eq $prop.SettingId -and $_.CategoryId -eq $prop.CategoryId -and $_.SubCategoryDefinition.Id -eq $prop.SubCategoryDefinition.Id }
|
||||||
|
$val1 = $prop2.$settingsValue
|
||||||
|
if($val2 -isnot [array] -and $val1 -is [array] -and $val1.Count -gt 1)
|
||||||
|
{
|
||||||
|
Write-Log "Multiple compare results returend for $($prop.Name). Using first result" 2
|
||||||
|
$val1 = $val1[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
Add-CompareProperty $prop.Name $val1 $val2 $prop.Category $prop.SubCategory
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Set-ColumnVisibility $true ($null -ne ($docObj1.Settings | Where SubCategory -ne $null))
|
||||||
|
|
||||||
foreach ($prop in $docObj1.Settings)
|
foreach ($prop in $docObj1.Settings)
|
||||||
{
|
{
|
||||||
if(($prop.EntityKey + $prop.Category + $prop.SubCategory) -in $addedProperties) { continue }
|
if(($prop.EntityKey + $prop.Category + $prop.SubCategory) -in $addedProperties) { continue }
|
||||||
|
|||||||
@@ -295,6 +295,7 @@ function Get-ObjectDocumentation
|
|||||||
Invoke-TranslateIntentObject $obj $objectType | Out-Null
|
Invoke-TranslateIntentObject $obj $objectType | Out-Null
|
||||||
$properties = @("Name","Value","Category","FullValueTable","RawValue","RecommendedValue","SettingId","Description")
|
$properties = @("Name","Value","Category","FullValueTable","RawValue","RecommendedValue","SettingId","Description")
|
||||||
$defaultDocumentationProperties = @("Name","Value","RecommendedValue")
|
$defaultDocumentationProperties = @("Name","Value","RecommendedValue")
|
||||||
|
$inputType = "Intent"
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Administrative Templates
|
#region Administrative Templates
|
||||||
@@ -1254,7 +1255,7 @@ function Add-SettingsSetting
|
|||||||
SettingName = $settingsDef.Name
|
SettingName = $settingsDef.Name
|
||||||
Name = $settingName
|
Name = $settingName
|
||||||
Description = $settingDescription
|
Description = $settingDescription
|
||||||
CategortyId = $objCategory.id
|
CategoryId = $objCategory.id
|
||||||
Category=$objCategory.displayName
|
Category=$objCategory.displayName
|
||||||
CategoryDefinition=$objCategory
|
CategoryDefinition=$objCategory
|
||||||
SubCategory=$subCategory.displayName
|
SubCategory=$subCategory.displayName
|
||||||
|
|||||||
Reference in New Issue
Block a user