[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms")
function weather {
$form = new-object System.Windows.Forms.Form
$cm = new-object System.Windows.Forms.ContextMenu
$miExit = new-object System.Windows.Forms.MenuItem
$miRefresh = new-object System.Windows.Forms.MenuItem
$ni = new-object System.Windows.Forms.NotifyIcon
$form.ContextMenu = $cm
$form.ContextMenu.MenuItems.Add($miRefresh)
$form.ContextMenu.MenuItems.Add($miExit)
$form.ShowInTaskbar = $false
$form.WindowState = "minimized"
$form.add_Load({
$wc = new-object System.Net.WebClient
$uri = "http://weather.msn.com/RSS.aspx?wealocations=wc:USNY0833&weadegreetype=F"
$rssData = [xml] $wc.DownloadString($uri)
$title = $rssData.rss.channel.title
$desc = $rssData.rss.channel.item[0].title
$ni.ShowBalloonTip(100, $title, $desc, [system.windows.forms.ToolTipIcon]"Info")
})
$ni = $ni
$ni.Icon = new-object System.Drawing.Icon("c:\msh\icons\test.ico")
$ni.ContextMenu = $cm
$miRefresh.Index = 0
$miRefresh.Text = "&Refresh"
$miRefresh.add_Click({
$wc = new-object System.Net.WebClient
$uri = "http://weather.msn.com/RSS.aspx?wealocations=wc:USNY0833&weadegreetype=F"
$rssData = [xml] $wc.DownloadString($uri)
$title = $rssData.rss.channel.title
$desc = $rssData.rss.channel.item[0].title
$ni.ShowBalloonTip(100, $title, $desc, [system.windows.forms.ToolTipIcon]"Info")
})
$miExit.Index = 1
$miExit.Text = "E&xit"
$miExit.add_Click({ $form.Close() })
$ni.visible = $true
$form.showDialog()
}
weather
Experimenting with a different format of blogs...