ファイルを解析して特定のパターンを検出した場合に電子メールを送信するpowershellスクリプトがあります。私は関数内に電子メールコードを設定していますが、ISEから実行するとうまく動作しますが、PS2EXEを使用してスクリプトをサービスとして実行できますが、関数 "email"は認識されません。私のコードは、このPowershellスクリプトが自分の関数を認識しない
#Do things |
foreach{
email($_)
}
function email($text){
#email $text
}
に似ています、私はそれをexeファイルと実行に変換すると、私はこのエラーを取得する:順序で
The term 'email' is not recognized as teh name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
ありがとうございます! – laitha0