I have been stuck on this for ages. I am trying to run the following command from a .ps1 file
cmd --% /c "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" "&&" nuget restore "&&" msbuild mywebapp.sln /p:DeployOnBuild=true /p:PublishProfile=ServerFolderProfile
But I keep getting the following error
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
I figured out how to run the command from a PowerShell window from a previous question.
Also, the Stop-Parsing --% symbol requires at least Version 3 of PowerShell and I am running version 5.1.
Test-Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat"?Test-Pathdid introduce me to a new problem I have to solve. The bat file is on my server, and if I run PowerShell from my local machine from a shared folder on my server, thenTest-Pathfails because it is looking on my local machine. So now I have to figure out how to get the Script to remote into my server, because when I runTest-Pathdirectly on my server it passes.