$ arglist =" / p:stuff = "Release|x64
" / P:InstallerStuff = "Release|x64
" / P:InstallerLanguages = "en-US
""
$ cmd =" ./ create.cmd"
invoke-expression $ cmd $ arglist
失败,因为arglist中有空格,我如何编码或转义空格,以便将它们传递给cmd脚本?
答案 0 :(得分:0)
$ args = $ arglist.split('') invoke-expression $ cmd $ args [0] $ args [1] $ args [2]