Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Say-Text {
- param ([Parameter(Mandatory=$true, ValueFromPipeline=$true)] [string] $Text)
- [Reflection.Assembly]::LoadWithPartialName('System.Speech') | Out-Null
- $object = New-Object System.Speech.Synthesis.SpeechSynthesizer
- $object.Speak($Text)}
- Invoke-WebRequest -uri 'http://w1.weather.gov/xml/current_obs/KOLM.xml' -OutFile C:\scripts\connectfeed.xml
- [xml]$content = Get-Content C:\Scripts\ConnectFeed.xml
- $date = Get-Date
- $location = $content.DocumentElement.location.split(',')[0]
- $temperature = $content.DocumentElement.temp_f.split('.')[0]
- $weather = $content.DocumentElement.weather
- $windspeed = $content.DocumentElement.wind_mph
- $winddir = $content.DocumentElement.wind_dir
- say-text "Good Morning, it is $date in $location the current weather condition is $weather, the Temperature is $temperature degrees farenheit, the wind is blowing at $windspeed Miles Per hour with the direction $winddir"
Advertisement
Add Comment
Please, Sign In to add comment