ConvertTo-FlatObject - Flatten objects to simplify schema and data discovery

This function simplifies the discovery of data and its schema

 
 
 
 
 
3.7 Star
(3)
3,067 times
Add to favorites
12/5/2014
E-mail Twitter del.icio.us Digg Facebook
  • Doesn't Include Properties when their name is "Name"
    3 Posts | Last post February 08, 2017
    • I have a XML node with an attribute of "Name".  It looks like this:
      <Test Name="Test1" Status="OK">
      
      With Exclude Default On the property name of "Name" in the Include argument, it does not return the Name attribute of one nor its value.  I thought at first maybe your function doesn't include attributes, but with "Status" in the Include field it returns that just fine (and attributes of other nodes return fine too).  
      
      I tried turning off "ExcludeDefault" but even with the tiny XML data I am feeding the function it runs seemingly forever with that turned off and returns WAY too much data to even make it worthwhile if it ever did eventually finish.    
      I tried editing the function to make it not ignore properties that re actually named "Name", but I can't figure out how your Exclusion function works for the life of me... It seems so basic yet it knows how to exclude certain properties.  I don't get it at all...
      Any ideas?
    • ***** CORRECTION TO MY QUESTION ABOVE *****
      
      -- This sentence:
      With Exclude Default On the property name of "Name" in the Include argument, it does not return the Name attribute of one nor its value. 
      
      -- Should actually read like this:
      With ExcludeDefault left set to "True" and the property name of "Name" in the Include argument, the function will still ignore the Test.Name attribute property.  I even tried putting "Test.Name" in the Include argument, but it didn't work.
    • Hi!
      
      Would you mind making a quick change and test for me with your XML (or send over a POC XML doc)?
      
      Append this:  | where {$Include -notcontains $_} 
      
      To this: https://github.com/RamblingCookieMonster/PowerShell/blob/master/ConvertTo-FlatObject.ps1#L260
      
      Without that, it will ignore explicitly included properties if they are in the default property list.
      
      Thanks!