I just gave up
My experience of Powershell is very limited, there is something improved hidden way down there somewhere, but why on earth does basic tasks have to be so obnoxiously hard to do?
My most recent struggles with it was trying to create a script to replace an old .bat file that just refused to work due to codepage issues (trying to get it to work with Swedish characters in a network path).
Issue 1; getting the beep thing to run scripts at all...
Issue 2: getting it to simply run a program on a network drive with specified (static) parameters.
After solving issue one which in no way shape or form should be an issue, and some tries at 2 I just gave up and realized it would take even more time then I had already spent on it (way more the a dirt simple task should ever take) and wrote a small C# program to just run the bloody thing, took me about ten minutes total and that is with some extra bells and whistles.
Would it be to much to ask that simple tasks like that should be extremely simple and intuitive to do?