Я хочу выполнить cmd на PowerShell, и эта команда использует точки с запятой. Затем PowerShell интерпретирует его как несколько команд. Как заставить PowerShell игнорировать точки с запятой и выполнить мою команду как уникальную команду?
Пример:
Invoke-Expression "msbuild /t:Build;PipelinePreDeployCopyAllFilesToOneFolder /p:Configuration=Debug;_PackageTempDir=$TargetFolder $WebProject"
Другой пример:
Invoke-Expression "test`;test2"
И второй пример ответа:
The term 'test' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:6
+ teste <<<< ;teste2
+ CategoryInfo : ObjectNotFound: (teste:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The term 'test2' is not recognized as the name of a cmdlet, function, script file, or operable program. Chec
k the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:13
+ teste;teste2 <<<<
+ CategoryInfo : ObjectNotFound: (teste2:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException