我正在尝试在PowerShell中运行以下命令。
这会产生错误。
PS C:\Users\Administrator> cmd /c "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\vsdevcmd.bat && nuget restore && msbuild mywebapp.sln /p:DeployOnBuild=true /p:PublishedProfile=ServerFolderProfile"
这会产生错误。
'C:\Program' is not recognized as an internal or external command.
我的路径中有空格,我要运行几个通过“&&”分隔的命令,这让一切都变得混乱了。我已经尝试在各处加上引号,但还是无法使其正常工作。
如果我只运行命令的第一部分
cmd /c "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\vsdevcmd.bat"
它可以正常工作。但是我无法使其他命令也正常工作。