0 Replies Latest reply on Mar 14, 2019 3:26 PM by Raja3206

    How to delete a weak referenced element using PowerShell ?

    Raja3206

      $gele = Get-AFElement -Name $ele1 -AFElement $element

      $gatt1 = Get-AFAttribute -Name 'District' -AFElement $gele

      $gatt2 = Get-AFAttribute -Name 'Switch' -AFElement $gele

       

      if(($gatt1.getvalue().Value -ne $CircuitName) -or ($gatt2.getvalue().Value -ne $SwitchName))

      {

       

      Write-host $gatt1.getvalue().value , $CircuitName

      Write-host $att2.getvalue().value , $SwitchName

       

      Remove-AFElement -AFElement $gele -CheckIn

      }

       

      Above is a small snippet from the code. My goal is to just remove the weak reference element. I'm able to access the weak referenced element using PowerShell but when i try to remove, it removes the original element. Also, i tried -DeleteAllReferences, as the name says it removes all the references which is not what i wanted. I wanted to remove only a one reference which doesn't align with my IF conditions.

       

      Any ideas on how to proceed ?

       

       

      Thanks,

      Raja