Skip to content

Instantly share code, notes, and snippets.

@gerane
Created July 21, 2016 18:20
Show Gist options
  • Select an option

  • Save gerane/6a82e446a18dfd5d30413ff5f9755a99 to your computer and use it in GitHub Desktop.

Select an option

Save gerane/6a82e446a18dfd5d30413ff5f9755a99 to your computer and use it in GitHub Desktop.
if ($Alert -ne $null)
{
$Env:WeatherAlert = $Alert
switch ($Alert.type)
{
'HUR' { $AlertType = 'Hurricane Local Statement' }
'TOR' { $AlertType = 'Tornado Warning' }
'TOW' { $AlertType = 'Tornado Watch' }
'WRN' { $AlertType = 'Severe Thunderstorm Warning' }
'SEW' { $AlertType = 'Severe Thunderstorm Watch' }
'WIN' { $AlertType = 'Winter Weather Advisory' }
'FLO' { $AlertType = 'Flood Warning' }
'WAT' { $AlertType = 'Flood Watch / Statement' }
'WND' { $AlertType = 'High Wind Advisory' }
'SVR' { $AlertType = 'Severe Weather Statement' }
'HEA' { $AlertType = 'Heat Advisory' }
'FOG' { $AlertType = 'Dense Fog Advisory' }
'SPE' { $AlertType = 'Special Weather Statement' }
'FIR' { $AlertType = 'Fire Weather Advisory' }
'VOL' { $AlertType = 'Volcanic Activity Statement' }
'HWW' { $AlertType = 'Hurricane Wind Warning' }
'REC' { $AlertType = 'Record Set' }
'REP' { $AlertType = 'Public Reports' }
'PUB' { $AlertType = 'Public Information Statement' }
}
Write-Host "[ALERT] $($AlertType): For more information see `$Env:WeatherAlert" -ForegroundColor Red
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment