Hi, PEK1254.
I highly recommend that you ask these questions in the Microsoft PowerShell forum.
These folks live and breathe PowerShell scripts. Check them out here:
https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell
Good luck!
P.S. If possible, please turn off your Caps Lock. Many people consider it as yelling.
:)
Best wishes, Davin Mickelson