Write-Output
for each ループの結果を表示するために使用する powershell スクリプトがあります。sendemail.exe
出力を電子メールで送信する必要があり、以前は以下のように VB でこれを行っていました
cscript //nologo script.vbs 2>&1 | sendEmail.exe -t mail@blah.co.uk -u "subject blah" -f mail@blah.co.uk -s smtpserver1.mail.co.uk
.ps1 スクリプトを実行すると、現在のコンソールに出力が書き込まれ、sendemail.exe アプリケーションにパイプされないため、powershell でこれを機能させることができません。別のコマンドレットが必要ですか、それとも電子メール機能をスクリプトに書き込む方が簡単ですか?