我尝试从命令行运行powershell脚本和参数,但总是失败,出现下面的错误。有人能帮忙吗?
cmd /c "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\start.ps1 -settings_override_xml /"<?xml version=/'1.0/'?><Settings><Keys>243</Keys></Settings>/""
错误:
< was unexpected at this time
我尝试从命令行运行powershell脚本和参数,但总是失败,出现下面的错误。有人能帮忙吗?
cmd /c "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\start.ps1 -settings_override_xml /"<?xml version=/'1.0/'?><Settings><Keys>243</Keys></Settings>/""
错误:
< was unexpected at this time
1条答案
按热度按时间4sup72z81#
中间的双引号用反勾号转义。
**编辑:**解释一下,它将您的原始命令读取为:
使用以下命令启动命令提示符:
然后导入以下内容作为该命令的参数或输入:
嗯,你是对的,它在〈上出错了,〈是一个保留字符,我打赌它在〉上也会出错。避开这些字符,它应该能工作。
测试,作为工作在我的机器上,没有给出错误。