0

バッチ ファイルから PowerShell スクリプトを実行しようとしていますが、機能していません。バットファイルは次のようになります。

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command “. ‘S:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.psc1'; Connect-ExchangeServer -auto; S:\Scripts\EnableTransportRuleWest.ps1"

Batファイルを実行したときのエラーは次のとおりです。

the string starting: at line:1 char:75
* . S:\Program files[snip] is missing the terminator '. at line:1 char:146

何が欠けているのかわかりません。

4

1 に答える 1

2

Did you copy this command line from a blog? You've "smart" quotes in there.

With normal double/single quotes:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'S:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.psc1'; Connect-ExchangeServer -auto; S:\Scripts\EnableTransportRuleWest.ps1"
于 2013-10-24T16:54:04.120 に答える