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#:
string[] folders = { '~/MyFolder/Test123', '~/MyFolder/Test987', '~/MyFolder/Test333' };
foreach (string item in folders) {
$_.Remove()
}
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:
param($installPath, $toolsPath, $package, $project)
$DTE.Solution.Projects|Select-Object -Expand ProjectItems|Where-Object{$_.Name -eq 'Controllers'}|ForEach-Object{$_.Remove()}
How would I incorporate a string array to this instead of the hard coded "Controllers" name.