[英]Running PowerShell script with arguments
I've been trying to run a PowerShell script with CMD without success. 我一直在尝试使用CMD运行PowerShell脚本,但没有成功。
The script i'm running: 我正在运行的脚本:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command 'C:\Program Files\Tivoli\TSM\start-tdpsql-instance.ps1' -dpsqloptfile h:\tsm\dsm.opt -dpsqlcfgfile h:\tsm\tdpsql.cfg
But unfortunately, i get an error message: 但不幸的是,我收到一条错误消息:
You must provide a value expression on the right-hand side of the '-' operator.
At line:1 char:58
+ 'C:\Program Files\Tivoli\TSM\start-tdpsql-instance.ps1' - <<<< dpsqloptfile h
:\tsm\dsm.opt -dpsqlcfgfile h:\tsm\tdpsql.cfg
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordEx
ception
+ FullyQualifiedErrorId : ExpectedValueExpression
Do you have any ideas why it isn't processing my arguments? 您有什么想法为什么它不处理我的论点?
I solved it! 我解决了! =]
=]
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command "& 'C:\Program Files\Tivoli\TSM\start-tdpsql-instance.ps1' -dpsqloptfile 'h:\tsm\dsm.opt' -dpsqlcfgfile 'h:\tsm\tdpsql.cfg'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.