protected override void ProcessRecord() { switch (ParameterSetName) { case "Properties": var newAddress = new AddressObject(Name, IPAddress.Parse(IpAddress), Description); addableRepository.Add(newAddress); if (PassThru) { WriteObject(newAddress); } break; case "Object": foreach (var addressObject in PanosAddress) { addableRepository.Add(addressObject); if (PassThru) { WriteObject(addressObject); } } break; } }
private void UpdateAddresses(AddressGroupObject adView, AddressGroupObject fwView) { var addressObjectsDetla = adView.GetDelta(fwView); if (addressObjectsDetla.Count > 0) { WriteVerbose("Address configuration drifted:"); foreach (var address in addressObjectsDetla) { addableRepository.Add(address); WriteVerbose($"Updating {address.Name}"); } } }