Hello,
I have JSON which has collection of elements and I need to remove and element and then save JSON. I’m lost as far as what do I need to use to remove an element.
PS C:\windows\system32> $jsonFile.resourcePackages
resourcePackage
---------------
@{name=SynopticPanelBySQLBI1447436165337; type=0; items=System.Object[]}
@{name=YourVisual1465156444568; type=0; items=System.Object[]}
@{name=BulletChartBySQLBI1459586236884; type=0; items=System.Object[]}
@{name=CandleStickBySQLBI1458002061454; type=0; items=System.Object[]}
@{name=SmartFilterBySQLBI1465232218990; type=0; items=System.Object[]}
@{name=SmartFilterBySQLBI1465231403311; type=0; items=System.Object[]}
PS C:\windows\system32> $jsonFile.resourcePackages.Remove(0)
Exception calling "Remove" with "1" argument(s): "Collection was of a fixed size."
At line:1 char:1
+ $jsonFile.resourcePackages.Remove(0)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : NotSupportedException