Geen omschrijving

SpeakTime.ps1 384B

1234567891011121314
  1. function Say-Time {
  2. [CmdletBinding()]
  3. param()
  4. # Get the current time
  5. $time = Get-Date -Format 'h:mm tt'
  6. # Use the System.Speech.Synthesis.SpeechSynthesizer class to speak the time
  7. Add-Type -AssemblyName System.Speech
  8. $synthesizer = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
  9. $synthesizer.Speak($time)
  10. }
  11. Say-Time

Powered by TurnKey Linux.