If I run this line in a PowerShell window, it executes perfectly
.\buildTestAndPublish.ps1 -buildPath 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0' -testPath 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow'
Now I need to automate this and I'm failing to do so
$pth = 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0'
$testPth = 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow'
start-process powershell -Verb runAs -ArgumentList "-file $PSScriptRoot\AutomationScripts\buildTestAndPublish.ps1 -buildPath $pth -testPath $testPth"
A positional parameter could not be found that accepts argument Files
This looks like it's complaining about the white space, but after a search, I've wrapped them in single quote marks AND pass them as variables (the advice I found online)
What do I need to do?