title: Use array in PowerShell to delete folders?
body: <p>I am new to PowerShell and trying to get used to the strange syntax. I am trying to delete an array of folder paths. This is how I would do it in C#:</p>
  
  <pre><code>string[] folders = { '~/MyFolder/Test123', '~/MyFolder/Test987', '~/MyFolder/Test333' };
  foreach (string item in folders) {
    $_.Remove()
  }
  </code></pre>
  
  <p>How would I accomplish this in PowerShell? I found the below script, but I'm not sure how to change to use a pre-defined array. The included parameters actually come from NuGet:</p>
  
  <pre><code>param($installPath, $toolsPath, $package, $project)
  
  $DTE.Solution.Projects|Select-Object -Expand ProjectItems|Where-Object{$_.Name -eq 'Controllers'}|ForEach-Object{$_.Remove()}
  </code></pre>
  
  <p>How would I incorporate a string array to this instead of the hard coded "Controllers" name.</p>