title: Get-ChildItem using variable for -Include Not Working
body: <p>Current Version of the Question:</p>
  
  <p>I initialize an array $tbd_list as follows: </p>
  
  <pre><code>$tbd_list = @()
  foreach($i in $tbd) {
      # -- If statement prevents duplicate id's
      if(!($tbd_list -match $i.id)){
          $tbd_list += $i.id
      }
  }
  </code></pre>
  
  <p>At this point, if I print $tbd_list I get: </p>
  
  <pre><code>"dce50fdd-2298-45db-8aac-fb13a176fe1a*.*"
  "79c1538f-09b1-4ed7-b84c-ff1a7934596a*.*"
  "60511686-7a87-4352-a781-62e7c04913e5*.*"
  "0821f8ee-c1ca-4568-ab68-bb5e30d07268*.*"
  "3b9f5da0-fc2d-49e3-a11d-943f5ac2296a*.*"
  "ff7720fd-2c0f-43c8-871a-e283f231c823*.*"
  </code></pre>
  
  <p>($tbd_list.GetType().FullName returns System.Object)</p>
  
  <p>I then try to run the following code: </p>
  
  <pre><code>Get-ChildItem F:\store_test\ -Recurse -Include $tbd_list
  </code></pre>
  
  <p>But, I get nothing in return.</p>
  
  <p>However, if I manually type this: </p>
  
  <pre><code>$tbd_list = "dce50fdd-2298-45db-8aac-fb13a176fe1a*.*", "79c1538f-09b1-4ed7-b84c-ff1a7934596a*.*", "60511686-7a87-4352-a781-62e7c04913e5*.*", "0821f8ee-c1ca-4568-ab68-bb5e30d07268*.*", "3b9f5da0-fc2d-49e3-a11d-943f5ac2296a*.*", "ff7720fd-2c0f-43c8-871a-e283f231c823*.*"
  </code></pre>
  
  <p>At this point, if I print $tbd_list I still get: </p>
  
  <pre><code>"dce50fdd-2298-45db-8aac-fb13a176fe1a*.*"
  "79c1538f-09b1-4ed7-b84c-ff1a7934596a*.*"
  "60511686-7a87-4352-a781-62e7c04913e5*.*"
  "0821f8ee-c1ca-4568-ab68-bb5e30d07268*.*"
  "3b9f5da0-fc2d-49e3-a11d-943f5ac2296a*.*"
  "ff7720fd-2c0f-43c8-871a-e283f231c823*.*"
  </code></pre>
  
  <p>and run the same line ($tbd_list.GetType().FullName still returns System.Object): </p>
  
  <pre><code>Get-ChildItem F:\store_test\ -Recurse -Include $tbd_list
  </code></pre>
  
  <p>It works perfectly. Any suggestions?    </p>
  
  <p><strong>Solution</strong></p>
  
  <p>Both answers below are correct, but I can only choose one.</p>
  
  <p>After making sure the variable was an array, I then had to remove the leading and trailing quotes and the script works. Thanks!</p>