1
私はPowerShellをかなり使い慣れています。私はその後、メール・ジェネレータに渡すいくつかのデータを格納する変数を作成しました:PowerShell - パイプライン - ハードコードされたプログラムと変数の比較
$strEmailFile = "C:\Testing\SomeTextFile.txt"
cat $strEmailFile | E:\sendmail.exe -t
私の問題は、私はハードコードに電子メール生成ソフトウェア用のドライブをしたくないです。だから私はこのようなものにするためのコードたい:
$strEmailFile = "C:\Testing\SomeTextFile.txt"
$Dir = "E:"
cat $strEmailFile | $Dir + "\sendmail.exe" -t
をしかし、私は、次のエラーを取得しておいてください。
"Expressions are only allowed as the first element of a pipeline."
は私がハードためにパイプラインを使用しますが、持っていないための方法はありますコード?
'Send-MailMessage'があるときにPowerShellで' sendmail.exe'を実行する必要はありません。 –