1 2 3 4 5 6 7 8 9 10 11 12 13 |
[void][reflection.assembly]::loadwithpartialname('system.speech') $rec = New-Object 'System.Speech.Recognition.SpeechRecognitionEngine' $rec.LoadGrammar((New-Object 'System.Speech.Recognition.DictationGrammar')) $rec.SetInputToDefaultAudioDevice() do { if($rec.Recognize().Text -match "mail") { "Enviar correo" Send-MailMessage -to "[email protected]" -from "[email protected]" -subject "Correo prueba" -SmtpServer localhost } }while(1) |