{"id":4222,"date":"2015-02-16T09:10:08","date_gmt":"2015-02-16T14:10:08","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=4222"},"modified":"2015-02-16T09:10:08","modified_gmt":"2015-02-16T14:10:08","slug":"baby-its-cold-outside","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/","title":{"rendered":"Baby, It&#8217;s Cold Outside"},"content":{"rendered":"<p>I don't know about your neck of the woods, but it is downright Arctic here. So I thought I'd polish up my PowerShell function to get weather data.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\nFunction Get-MyWeather {\r\n&lt;#\r\n.Synopsis\r\nGet the weather for a US zip code\r\n.Description\r\nThis command will query the Yahoo weather service and return weather conditions for a US zip code.\r\n.Example\r\nPS C:\\&gt; get-myweather 98133\r\n\r\nLocation    : Seattle, WA\r\nDate        : 2\/16\/2015 4:53:00 AM\r\nTemperature : 45\r\nLow         : 38\r\nHigh        : 60\r\nConditions  : Mostly Cloudy\r\n\r\n.Notes\r\nLearn more about PowerShell:\r\n<blockquote class=\"wp-embedded-content\" data-secret=\"kEJJkhp58E\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/essential-powershell-resources\/\">Essential PowerShell Learning Resources<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Essential PowerShell Learning Resources&#8221; &#8212; The Lonely Administrator\" src=\"https:\/\/jdhitsolutions.com\/blog\/essential-powershell-resources\/embed\/#?secret=Icdkvg5ny3#?secret=kEJJkhp58E\" data-secret=\"kEJJkhp58E\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\r\n\r\n  ****************************************************************\r\n  * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED *\r\n  * THOROUGHLY IN A LAB ENVIRONMENT. USE AT YOUR OWN RISK.  IF   *\r\n  * YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, *\r\n  * DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING.             *\r\n  ****************************************************************\r\n.Link\r\nInvoke-RestMethod\r\n#&gt;\r\n\r\nParam(\r\n[Parameter(Position=0,HelpMessage=\"Enter a United States zip code\")]\r\n[ValidateNotNullorEmpty()]\r\n[string]$Zip='00000'\r\n)\r\n\r\n#construct the URI\r\n$uri = \"http:\/\/xml.weather.yahoo.com\/forecastrss?p=$Zip\"\r\n\r\nTry {\r\n    #gets XML data\r\n    $data = Invoke-RestMethod -Uri $uri -ErrorAction Stop\r\n\r\n    write-verbose ($data | out-string)\r\n    if ($data.title -ne 'city not found') {\r\n\r\n        #get title string and parse out location and time using\r\n        #named regular expression captures\r\n       \r\n        $rx = \"(?&lt;location&gt;\\S+,\\s\\S+) at (?&lt;time&gt;\\d{1,2}:\\d{2}\\s(a|p)m)\"\r\n        $data.title -match $rx | out-Null      \r\n        Write-Verbose ($matches | out-string)\r\n        $location = $matches.location\r\n        $dt = $matches.time -as [datetime]\r\n\r\n        #write a custom object to the pipeline\r\n        [pscustomobject][ordered]@{\r\n         Location    = $location\r\n         Date        = $dt\r\n         Temperature = $data.condition.temp -as [int]\r\n         Low         = $data.forecast[0].low -as [int]\r\n         High        = $data.forecast[0].high -as [int]\r\n         Conditions  = $data.condition.text\r\n        } #close hash table \r\n    }\r\n    else {\r\n        Write-Warning \"No city found for zip code $zip\"\r\n    }\r\n} #Try\r\nCatch {\r\n    #throw the exception\r\n    Throw $_\r\n}\r\n\r\n} #end function\r\n\r\n<\/pre>\n<p>This function uses the Yahoo weather RSS feed for US locations. The function uses the Invoke-RestMethod to get an entry for a given zip code. I set my zip code as the default and suggest you do the same. You will need to modify the default value in the code above. Invoke-RestMethod gives me an XML document so it isn't too difficult to pull out the values I want and construct a custom object. I even use some regular expression named captures to break out the location and time. So hopefully there are some good learning examples here.<\/p>\n<p>Anyway, quite frigid here, and this is already 5 degrees warmer than when I got up.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather-300x138.png\" alt=\"weather\" width=\"300\" height=\"138\" class=\"aligncenter size-medium wp-image-4223\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather-300x138.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather.png 851w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Hope you are staying warm.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t know about your neck of the woods, but it is downright Arctic here. So I thought I&#8217;d polish up my PowerShell function to get weather data. #requires -version 3.0 Function Get-MyWeather { &lt;# .Synopsis Get the weather for a US zip code .Description This command will query the Yahoo weather service and return&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Baby, It's Cold Outside - so says #PowerShell","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,359,8],"tags":[224,429,534,540,208],"class_list":["post-4222","post","type-post","status-publish","format-standard","hentry","category-powershell","category-powershell-3-0","category-scripting","tag-function","tag-invoke-restmethod","tag-powershell","tag-scripting","tag-weather"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Baby, It&#039;s Cold Outside &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Baby, It&#039;s Cold Outside &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I don&#039;t know about your neck of the woods, but it is downright Arctic here. So I thought I&#039;d polish up my PowerShell function to get weather data. #requires -version 3.0 Function Get-MyWeather { &lt;# .Synopsis Get the weather for a US zip code .Description This command will query the Yahoo weather service and return...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2015-02-16T14:10:08+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather-300x138.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Baby, It&#8217;s Cold Outside\",\"datePublished\":\"2015-02-16T14:10:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/\"},\"wordCount\":154,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/weather-300x138.png\",\"keywords\":[\"Function\",\"Invoke-RestMethod\",\"PowerShell\",\"Scripting\",\"weather\"],\"articleSection\":[\"PowerShell\",\"Powershell 3.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/\",\"name\":\"Baby, It's Cold Outside &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/weather-300x138.png\",\"datePublished\":\"2015-02-16T14:10:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/weather.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/02\\\/weather.png\",\"width\":851,\"height\":391},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4222\\\/baby-its-cold-outside\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Baby, It&#8217;s Cold Outside\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Baby, It's Cold Outside &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/","og_locale":"en_US","og_type":"article","og_title":"Baby, It's Cold Outside &#8226; The Lonely Administrator","og_description":"I don't know about your neck of the woods, but it is downright Arctic here. So I thought I'd polish up my PowerShell function to get weather data. #requires -version 3.0 Function Get-MyWeather { &lt;# .Synopsis Get the weather for a US zip code .Description This command will query the Yahoo weather service and return...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/","og_site_name":"The Lonely Administrator","article_published_time":"2015-02-16T14:10:08+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather-300x138.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Baby, It&#8217;s Cold Outside","datePublished":"2015-02-16T14:10:08+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/"},"wordCount":154,"commentCount":5,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather-300x138.png","keywords":["Function","Invoke-RestMethod","PowerShell","Scripting","weather"],"articleSection":["PowerShell","Powershell 3.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/","name":"Baby, It's Cold Outside &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather-300x138.png","datePublished":"2015-02-16T14:10:08+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather.png","width":851,"height":391},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Baby, It&#8217;s Cold Outside"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":731,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/731\/powershell-weather-module\/","url_meta":{"origin":4222,"position":0},"title":"PowerShell Weather Module","author":"Jeffery Hicks","date":"July 26, 2010","format":false,"excerpt":"I first wrote a Windows PowerShell function several years ago to retrieve weather information via Yahoo's weather service. I've been itching to rewrite it and finally found some time over the weekend. Turns out it's a good thing I did because the method I had been using to query the\u2026","rel":"","context":"In &quot;Miscellaneous&quot;","block_context":{"text":"Miscellaneous","link":"https:\/\/jdhitsolutions.com\/blog\/category\/miscellaneous\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":138,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/138\/practical-powershell-scripts-and-code\/","url_meta":{"origin":4222,"position":1},"title":"Practical PowerShell Scripts and Code","author":"Jeffery Hicks","date":"March 11, 2008","format":false,"excerpt":"If you've been reading the Windows Administration in RealTime ejournal, I hope you've enjoyed my Practical PowerShell column. If not, you're missing out. Each column solves a real-world and practical problem with PowerShell. I explain how the PowerShell code works and why. It's not only a great way to learn\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3117,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/3117\/msdevwny-powershell-advanced-functions\/","url_meta":{"origin":4222,"position":2},"title":"MSDevWNY PowerShell Advanced Functions","author":"Jeffery Hicks","date":"June 20, 2013","format":false,"excerpt":"Last night I presented for the MSDevWNY user group in the Buffalo, NY area. They were an interested and enthusiastic audience and I think we could have spent another few hours talking about PowerShell. My presentation was one I've given before on Advanced PowerShell functions. I promised the group a\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"talkbubble-v3","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/05\/talkbubble-v3-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4232,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4232\/getting-the-weather-where-on-earth\/","url_meta":{"origin":4222,"position":3},"title":"Getting the Weather Where On Earth","author":"Jeffery Hicks","date":"February 17, 2015","format":false,"excerpt":"Yesterday I posted a popular article about using Invoke-WebRequest to get weather conditions. That function used the Yahoo web site but really only worked for US cities. So I also cleaned up and revised another set of advanced PowerShell functions (required PowerShell 3) that can retrieve weather information for probably\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3971,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3971\/tracking-your-day-with-powershell\/","url_meta":{"origin":4222,"position":4},"title":"Tracking Your Day with PowerShell","author":"Jeffery Hicks","date":"August 26, 2014","format":false,"excerpt":"Not too long ago, I received an email with a snippet of PowerShell code and a request for assistance. The code snippet used a little .NET code to retrieve the process for the currently active window. The goal was to have a PowerShell script run, keeping track of how long\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"timer","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2044,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2044\/maximizing-the-powershell-console-title-bar\/","url_meta":{"origin":4222,"position":5},"title":"Maximizing the PowerShell Console Title Bar","author":"Jeffery Hicks","date":"January 31, 2012","format":false,"excerpt":"A few days ago Boe Prox posted some very nifty PowerShell modules for using the title bar as a ticker for RSS feeds like the weather. I thought this was an awesome idea and an easy way to take advantage of what would otherwise be unused screen space. I was\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/01\/console-title-sysstat-300x85.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4222"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4222\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}