title: powershell select all objects from type Directory
body: <p>i try to write a script, that checks all Directories in a root Directory, is there a way to only select objects from datatype &quot;Directory&quot;?</p>
  <p>i tried to store all the directories into an array, but this dont worked for me.</p>
  <p>if i could store all Directory names inside the root Directory this would help me a lot.</p>
  <p><em>What i done before:</em></p>
  <p>create a list that stores all directory names:</p>
  <p><code>$sidepaths = New-Object System.Collections.Generic.List[System.Object]</code></p>
  <p>i tried to select all directories with <code>-ItemType Directory</code> but this dont worked for me.</p>