title: Unable to perform Add-Member: "Array dimensions exceeded supported range."
body: <p>I have an object named <strong>$restoreItems</strong> that I would like to filter for duplicates property values and select the most recent one.</p>
  
  <p>Please have a look at its members first to understand what I'm working with:</p>
  
  <p><a href="https://i.stack.imgur.com/AhzuS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AhzuS.png" alt="enter image description here"></a></p>
  
  <p>In order to be able to check for duplicates I need a combination of the 'DirName' + 'LeafName' properties as this combination builds a complete file path.</p>
  
  <p>This is my first issue. I am not able to combine the two properties and add it to that object. I tried to add a new member like so:</p>
  
  <pre><code>$restoreItems | Add-Member -NotePropertyName fullPath -NotePropertyValue 
  ($restoreItems.Dirname + '/' + $restoreItems.LeafName)
  </code></pre>
  
  <p>This command runs fine but upon calling</p>
  
  <pre><code>$restoreItems.fullPath
  </code></pre>
  
  <p>I get an error stating <strong>'Array dimensions exceeded supported range.'</strong></p>
  
  <p>Is there another way to add <strong>$restoreItems.Dirname + '/' + $restoreItems.LeafName</strong> to the object? If so I could probably find a way to exclude duplicates according to their  <strong>DeletedDate</strong> property.</p>
  
  <p>Thanks for your help.</p>
  
  <p>Edit: Here's .GetType() for the object:</p>
  
  <p><a href="https://i.stack.imgur.com/PzuKV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PzuKV.png" alt="enter image description here"></a></p>