{"id":4618,"date":"2015-11-27T09:41:28","date_gmt":"2015-11-27T14:41:28","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=4618"},"modified":"2015-11-27T09:48:26","modified_gmt":"2015-11-27T14:48:26","slug":"friday-fun-holiday-shopping-with-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/","title":{"rendered":"Friday Fun: Holiday Shopping with PowerShell"},"content":{"rendered":"<p>Once again, the holiday shopping season is upon us. But perhaps PowerShell can make it a little easier or at least a bit more fun. I'm sure many of you have shopped at NewEgg.com. Perhaps you plan to do so again this year for friends, family or even yourself. So why not let PowerShell make this a bit easier.<\/p>\n<p>NewEgg is savvy enough to publish RSS feeds for a number of their sales categories. You can find a master list at <a href=\"http:\/\/www.newegg.com\/RSS\/Index.aspx\" target=\"_blank\">http:\/\/www.newegg.com\/RSS\/Index.aspx<\/a>.\u00a0 Let's take their Deal of the Day feed.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$uri = \"http:\/\/www.newegg.com\/Product\/RSS.aspx?Submit=RSSDailyDeals&amp;Depa=0\"\r\n<\/pre>\n<p>Using <a title=\"Read online help for Invoke-RestMethod\" href=\"http:\/\/go.microsoft.com\/fwlink\/p\/?linkid=293987\" target=\"_blank\">Invoke-RestMethod<\/a>, it is very easy to retrieve items.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">Invoke-RestMethod -Uri $uri\r\n<\/pre>\n<p>But it is still a bit of a jumble, so let's get a bit more selective.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$data = Invoke-RestMethod -Uri $uri | Select -property @{Name=\"Published\";Expression= {$_.pubDate -as [datetime]}},Title,Link\r\n<\/pre>\n<p>I also created a new property called Published which takes the original PubDate and treats it as a date which makes the data easier to sort or filter.<\/p>\n<p>Here's a sample of what I retrieved.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo1.png\" alt=\"A NewEgg Deal of Day item\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>A NewEgg Deal of Day item (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>With this data, I can use <a title=\"Read online help for Out-Gridview\" href=\"http:\/\/go.microsoft.com\/fwlink\/p\/?linkid=293997\" target=\"_blank\">Out-Gridview<\/a> as an object-picker.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$data | out-gridview -Title \"Deal of the Day\" -OutputMode Multiple | foreach { Start $_.link }\r\n<\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo2.png\" alt=\"Links in Out-Gridview\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>Links in Out-Gridview (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>I can select multiple entries, click OK and each link should open up in my browser.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo3.png\" alt=\"The online deal\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>The online deal (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>But let's make things a bit more interesting. The Title property includes the price and description. I have no idea what these links look like in other parts of the world so you may have to adjust the following examples.<\/p>\n<p>First, I'm going to define a regular expression pattern to use named captures to get the currency, in my case $, the price and the item description.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">[regex]$rx = \"(?&lt;currency&gt;.)(?&lt;price&gt;\\d+\\.\\d{2})\\s-\\s(?&lt;item&gt;.*)\"\r\n<\/pre>\n<p>I'm going to re-download the data skipping any entry that doesn't have what looks like a price in the title field.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$dl = Invoke-RestMethod -Uri $uri | where {$_.Title -match \"\\d+\\.\\d{2}\"}\r\n<\/pre>\n<p>My goal is to use Out-Gridview again with separate properties for the currency and price. I need the price to be numeric so that I can sort on it. I next get the currency symbol using the regex expression.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$c = $rx.match($dl[0].title).groups[\"currency\"].value\r\n<\/pre>\n<p>Then I can process the rest of the RSS data, using the regex object to parse out the price and description.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$data = $dl |\r\nSelect -property @{Name=\"Published\";Expression= {$_.pubDate -as [datetime]}},\r\n@{Name=$c;Expression = {$rx.match($_.title).groups[\"price\"].value -as [double]}},\r\n@{Name=\"Item\";Expression = {$rx.match($_.title).groups[\"item\"].value }},\r\nLink\r\n<\/pre>\n<p>If you notice, I used the Currency value as a property name. Now when I use Out-Gridview I have a more flexible display.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$data | Sort $c \u2013descending | Out-GridView -Title $uri -OutputMode Multiple |\r\nforeach {\r\n#open each selected link\r\nstart $_.link\r\n}\r\n<\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo4.png\" alt=\"Reformatted Deals\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>Reformatted Deals (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>If I'm shopping for a new laptop, I can select multiple entries, click OK and review them in my browser.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo5.png\" alt=\"Viewing my choices\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>Viewing my choices (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>I can repeat the process by changing the RSS feed, say to their Shell Shocker<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$uri = \"http:\/\/www.newegg.com\/Product\/RSS.aspx?Submit=ShellShocker\"\r\n<\/pre>\n<p>If I repeat the previous steps, this will fail, which brings up something to keep in mind with regular expressions: know your data. You have to know what you are processing and that it follows a predictable pattern. At least if you want to keep your regular expression patterns relatively simple. The problem here is that there is only a single item. So my code to get the currency figure fails, because I don't have an array. In this situation I could do this:<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$c = $rx.match($dl.title).groups[\"currency\"].value\r\n<\/pre>\n<p>Although it might make more sense to come up with code that I can re-use.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$entry = $dl | select -first 1\r\n$c = $rx.match($dl.title).groups[\"currency\"].value\r\n<\/pre>\n<p>But from here the code is the same.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo6.png\" alt=\"Shell Shocker item\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>Shell Shocker item (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>That might be something I want to look into, although sometimes the RSS feeds are bit behind the site. Sadly, in this case, the link works, but the product is something else. But you get the idea.<\/p>\n<p>Enjoy your holiday weekend and be careful out there!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once again, the holiday shopping season is upon us. But perhaps PowerShell can make it a little easier or at least a bit more fun. I&#8217;m sure many of you have shopped at NewEgg.com. Perhaps you plan to do so again this year for friends, family or even yourself. So why not let PowerShell make&#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":"New from the blog -> Friday Fun: Holiday Shopping with #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":[271,4],"tags":[568,429,534],"class_list":["post-4618","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-friday-fun","tag-invoke-restmethod","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun: Holiday Shopping with PowerShell &#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\/4618\/friday-fun-holiday-shopping-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: Holiday Shopping with PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Once again, the holiday shopping season is upon us. But perhaps PowerShell can make it a little easier or at least a bit more fun. I&#039;m sure many of you have shopped at NewEgg.com. Perhaps you plan to do so again this year for friends, family or even yourself. So why not let PowerShell make...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-27T14:41:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-11-27T14:48:26+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo1.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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: Holiday Shopping with PowerShell\",\"datePublished\":\"2015-11-27T14:41:28+00:00\",\"dateModified\":\"2015-11-27T14:48:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/\"},\"wordCount\":601,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/112715_1441_FridayFunHo1.png\",\"keywords\":[\"Friday Fun\",\"Invoke-RestMethod\",\"PowerShell\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/\",\"name\":\"Friday Fun: Holiday Shopping with PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/112715_1441_FridayFunHo1.png\",\"datePublished\":\"2015-11-27T14:41:28+00:00\",\"dateModified\":\"2015-11-27T14:48:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/112715_1441_FridayFunHo1.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/112715_1441_FridayFunHo1.png\",\"width\":891,\"height\":212},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4618\\\/friday-fun-holiday-shopping-with-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: Holiday Shopping with PowerShell\"}]},{\"@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":"Friday Fun: Holiday Shopping with PowerShell &#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\/4618\/friday-fun-holiday-shopping-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: Holiday Shopping with PowerShell &#8226; The Lonely Administrator","og_description":"Once again, the holiday shopping season is upon us. But perhaps PowerShell can make it a little easier or at least a bit more fun. I'm sure many of you have shopped at NewEgg.com. Perhaps you plan to do so again this year for friends, family or even yourself. So why not let PowerShell make...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2015-11-27T14:41:28+00:00","article_modified_time":"2015-11-27T14:48:26+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo1.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: Holiday Shopping with PowerShell","datePublished":"2015-11-27T14:41:28+00:00","dateModified":"2015-11-27T14:48:26+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/"},"wordCount":601,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo1.png","keywords":["Friday Fun","Invoke-RestMethod","PowerShell"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/","name":"Friday Fun: Holiday Shopping with PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo1.png","datePublished":"2015-11-27T14:41:28+00:00","dateModified":"2015-11-27T14:48:26+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo1.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/11\/112715_1441_FridayFunHo1.png","width":891,"height":212},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4618\/friday-fun-holiday-shopping-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: Holiday Shopping with PowerShell"}]},{"@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":7278,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7278\/friday-fun-powershell-ascii-art\/","url_meta":{"origin":4618,"position":0},"title":"Friday Fun PowerShell ASCII Art","author":"Jeffery Hicks","date":"February 14, 2020","format":false,"excerpt":"Today's post is definitely on the fun side. In fact, I apologize in advance for the afternoon you are about to blow playing with this code. Those of you of a certain age will recall dial up modems and bulletin boards. Part of the experience was visual. Board operators often\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-17.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-17.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-17.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-17.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3140,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/3140\/friday-fun-quote-of-the-day-revised\/","url_meta":{"origin":4618,"position":1},"title":"Friday Fun: Quote of the Day Revised","author":"Jeffery Hicks","date":"June 28, 2013","format":false,"excerpt":"This week TrainSignal has been running a contest to celebrate my new PowerShell 3.0 course . All you have to do to win is enter some off-the-wall, silly or non-production use of PowerShell. I've posted a few examples on the TrainSignal blog this week. \u00a0These Friday Fun posts I write\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"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":4222,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4222\/baby-its-cold-outside\/","url_meta":{"origin":4618,"position":2},"title":"Baby, It&#8217;s Cold Outside","author":"Jeffery Hicks","date":"February 16, 2015","format":false,"excerpt":"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 { <# .Synopsis Get the weather for a US zip code .Description This command will query the\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"weather","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/02\/weather-300x138.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3627,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3627\/friday-fun-with-rest-regex-and-replacements\/","url_meta":{"origin":4618,"position":3},"title":"Friday Fun with REST, Regex and Replacements","author":"Jeffery Hicks","date":"January 24, 2014","format":false,"excerpt":"I just love using the web cmdlets that were introduced in PowerShell 3.0. One of the cmdlets I use the most is Invoke-RESTMethod. This isn't because I'm dealing with sites that offer REST-ful services, but rather I like that the cmdlet does all the heavy lifting for me when I\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"computereye","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/04\/computereye-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8163,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8163\/friday-fun-powershell-weather-widget\/","url_meta":{"origin":4618,"position":4},"title":"Friday Fun: PowerShell Weather Widget","author":"Jeffery Hicks","date":"February 12, 2021","format":false,"excerpt":"Recently, someone on Twitter turned me on to an resource that could be used in a PowerShell session to display weather information. This is apparently a well-established and well-regarded source. Once I worked out the basics, I naturally wanted to see what else I could do it with. Here's what\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/weather-samples.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/weather-samples.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/weather-samples.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/weather-samples.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/weather-samples.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":3982,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3982\/friday-fun-read-me-a-story\/","url_meta":{"origin":4618,"position":5},"title":"Friday Fun: Read Me a Story","author":"Jeffery Hicks","date":"August 29, 2014","format":false,"excerpt":"A few days ago, someone on Twitter humorously lamented the fact that I expected them to actually read a blog post. After the laughter subsided I thought, well why does he have to? Perhaps I can make it easier for him. Plus I needed something fun for today. So I\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"announcer","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/12\/announcer.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4618","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=4618"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4618\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}