Welcome to the forums.
Powershell is easily able to handle lists/arrays of elements with loops like about_foreach or Foreach-Object. That’s actually a very basic technique. If you’re not familiar with this you may restart learning the very basics of PowerShell first. That will save you from a lot of wasted time and frustration.
A - as I think - still good starting point would be this: Getting Started with PowerShell 3.0 (don’t worry if it’s not about the current version of PowerShell - the basics are still the same )
Regardless of that: When you post code please format it as code. Thanks in advance.
Here you can read how that works: