Hi all
I created a script to configure a vlan bridge on a segment. But when I run the script multiple times, my variables $segment , $bridgeProflie, $vlanTz become arrays with duplicate elements.
When I disconnect and reconnect my session, it will work again for one run.
Obviously I can work around this but I would like to understand why this is happening.
First run:
PS /Users/filipsmeets/repos> $segment.GetType() | Fl Basetype
BaseType : VMware.Bindings.Nsx.Policy.Model.PolicyConfigResource
Second run:
PS /Users/filipsmeets/repos> $segment.GetType() | Fl Basetype
BaseType : System.Array
Duplicate entries in the Array after second run:
S /Users/filipsmeets/repos> $segment |fl DisplayName
DisplayName : example-segment
DisplayName : example-segment