【发布时间】:2019-12-13 00:08:56
【问题描述】:
我的任务是将批处理脚本转换为 powershell。此批处理脚本只是将参数传递给 mysql.exe 以运行查询并将其导出到 .txt 文件中。这在作为批处理文件运行时有效,但是由于将其粘贴到 powershell 中,我得到了下面描述的错误。
代码:
cd "C:\PS\mysql" .\mysql.exe --defaults-file=C:\PS\mysql\my.ini
--defaults-group-suffix=marketing -A -n < C:\PS\mysql\SQLGFHW.sql > C:\PS\output.txt
这是我得到的错误:
At C:\PS\googleCons.ps1:3 char:88
+ ... =C:\PS\mysql\my.ini --defaults-group-suffix=marketing -A -n < C:\PS\m ...
+ ~
The '<' operator is reserved for future use.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RedirectionNotSupported
我预计
感谢任何帮助。 谢谢
【问题讨论】:
标签: mysql powershell parameters arguments