My final goal is to have a .bat file that calls a powershell script.
This works OK in powershell (but can't be used in a batch file):
PS build-directory> .\ps1file.ps1 -ScriptArgs '-arg1="val1"', '-arg2="val2"'
But this one (batch file friendly) fails:
PS build-directory> powershell -File ps1file.ps1 -ScriptArgs '-arg1="val1"', '-arg2="val2"'
A parameter cannot be found that matches parameter name 'arg2=val2'.
But it works fine if there is only one param -arg1="val1"