@@ -718,7 +718,12 @@ function ConvertTo-Element {
718
718
$Result.id = $Object .$prop
719
719
}
720
720
else {
721
- $Result .$prop = $Object .$prop
721
+ if ($Object .$prop.GetType ().IsArray)
722
+ {
723
+ $Result .$prop = $Object .$prop [0 ]
724
+ } else {
725
+ $Result .$prop = $Object .$prop
726
+ }
722
727
}
723
728
write-verbose ($Result | out-String )
724
729
}
@@ -731,7 +736,12 @@ function ConvertTo-Element {
731
736
$Result.id = $Object .$prop
732
737
}
733
738
else {
734
- $Result .$prop = $Object .$prop
739
+ if ($Object .$prop.GetType ().IsArray)
740
+ {
741
+ $Result .$prop = $Object .$prop [0 ]
742
+ } else {
743
+ $Result .$prop = $Object .$prop
744
+ }
735
745
}
736
746
}
737
747
}
@@ -743,7 +753,12 @@ function ConvertTo-Element {
743
753
$Result.id = $Object .$prop
744
754
}
745
755
else {
746
- $Result .$prop = $Object .$prop
756
+ if ($Object .$prop.GetType ().IsArray)
757
+ {
758
+ $Result .$prop = $Object .$prop [0 ]
759
+ } else {
760
+ $Result .$prop = $Object .$prop
761
+ }
747
762
}
748
763
}
749
764
}
@@ -755,7 +770,12 @@ function ConvertTo-Element {
755
770
$Result.id = $Object .$prop
756
771
}
757
772
else {
758
- $Result .$prop = $Object .$prop
773
+ if ($Object .$prop.GetType ().IsArray)
774
+ {
775
+ $Result .$prop = $Object .$prop [0 ]
776
+ } else {
777
+ $Result .$prop = $Object .$prop
778
+ }
759
779
}
760
780
}
761
781
}
@@ -784,7 +804,12 @@ function ConvertTo-Element {
784
804
$Result.schema = $Object .$prop
785
805
}
786
806
else {
787
- $Result .$prop = $Object .$prop
807
+ if ($Object .$prop.GetType ().IsArray)
808
+ {
809
+ $Result .$prop = $Object .$prop [0 ]
810
+ } else {
811
+ $Result .$prop = $Object .$prop
812
+ }
788
813
}
789
814
}
790
815
}
@@ -813,7 +838,12 @@ function ConvertTo-Element {
813
838
}
814
839
}
815
840
else {
816
- $Result .$prop = $Object .$prop
841
+ if ($Object .$prop.GetType ().IsArray)
842
+ {
843
+ $Result .$prop = $Object .$prop [0 ]
844
+ } else {
845
+ $Result .$prop = $Object .$prop
846
+ }
817
847
}
818
848
}
819
849
}
0 commit comments