{"id":4030,"date":"2014-09-19T09:34:18","date_gmt":"2014-09-19T13:34:18","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=4030"},"modified":"2014-09-19T09:34:18","modified_gmt":"2014-09-19T13:34:18","slug":"friday-fun-does-anyone-really-know-what-day-it-is","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/","title":{"rendered":"Friday Fun &#8211; Does Anyone Really Know What Day It Is?"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/eternalclock_150x150.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-3608\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/eternalclock_150x150.png\" alt=\"eternalclock_150x150\" width=\"150\" height=\"150\" \/><\/a> This week's Friday Fun I think epitomizes how much I think about PowerShell. But I also think it will serve as a useful learning device if not something you might actually want to use. For some reason, I thought it would be useful to quickly display a monthly calendar in PowerShell. Sure, I could click over to the clock on the start bar and navigate to a calendar. But then I have to take my hands off the keyboard and click around with a mouse. I'd much rather type a quick command, maybe give it a date and see the results. So this is what I came up with: Get-Calendar.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 2.0\r\n\r\nFunction Get-Calendar {\r\n\r\n&lt;#\r\n.Synopsis\r\nDisplay a monthly calendar\r\n.Description\r\nThis command will display calendar month based on the given date.\r\n.Example\r\nPS C:\\&gt; get-calendar\r\n\r\n      September 2014\r\nSun Mon Tue Wed Thu Fri Sat\r\n      1   2   3   4   5   6\r\n  7   8   9  10  11  12  13\r\n 14  15  16  17  18  19  20\r\n 21  22  23  24  25  26  27\r\n 28  29  30\r\n .Example\r\n PS C:&gt; 1..12 | foreach {get-calendar \"$_\/1\/2015\"} | Out-file c:\\work\\2015.txt\r\nCreate a calendar text file for 2015 using a North American date format.\r\n.Notes\r\nLast Updated: September 16, 2014\r\nVersion     : 1.0\r\n\r\nLearn more:\r\n PowerShell in Depth: An Administrator's Guide (http:\/\/www.manning.com\/jones6\/)\r\n PowerShell Deep Dives (http:\/\/manning.com\/hicks\/)\r\n Learn PowerShell 3 in a Month of Lunches (http:\/\/manning.com\/jones3\/)\r\n Learn PowerShell Toolmaking in a Month of Lunches (http:\/\/manning.com\/jones4\/)\r\n\r\n.Link\r\nhttp:\/\/jdhitsolutions.com\/blog\/2014\/09\/friday-fun-does-anyone-really-know-what-day-it-is\r\n.Link\r\nGet-Date\r\nGet-Culture\r\n#&gt;\r\n\r\n[cmdletbinding()]\r\nParam(\r\n[Parameter(Position=0)]\r\n[ValidateNotNullorEmpty()]\r\n[datetime]$Date = (Get-Date)\r\n)\r\n\r\n#get some information about weekday names that is culture specific\r\n$cult = Get-Culture\r\n$cal = $cult.Calendar\r\n$ui = Get-UICulture\r\n\r\n$daysOfWeek = $ui.DateTimeFormat.AbbreviatedDayNames\r\n$startWeek = $daysOfWeek[0]\r\n#create a string with the days of the week\r\n$days = $DaysOfWeek -join \" \"\r\n\r\n#how many days in the month\r\n$intDays = $cal.GetDaysInMonth($Date.year,$Date.month)\r\n\r\n#get the first day of the month\r\n[datetime]$firstday = $Date.addDays(-$Date.Day+1)\r\n\r\n&lt;#\r\nI want to align each row of weekdays with the days of the week header.\r\nI need to align the first day of the first week.\r\n#&gt;\r\n\r\n$week1=@()\r\nfor ($i=0;$i -lt 7;$i++) {\r\nif ((\"{0:ddd}\" -f $firstday) -eq $ui.DateTimeFormat.AbbreviatedDayNames[$i] ) {\r\n  #I am assuming all short day abbreviations will be 3 characters\r\n  $week1+=$firstday.Day.ToString().PadLeft(3)\r\n  #got the date so move on\r\n  break\r\n}\r\nelse {\r\n #add an empty day\r\n $week1+=\"   \"\r\n} \r\n}\r\n\r\n#fill out the rest of the week\r\n$j = 1\r\n#loop through until we reach the end of the week\r\nwhile ($i -le 5) {\r\n    $week1+=$firstday.AddDays($j).day.ToString().PadLeft(3)\r\n    $i++\r\n    $j++\r\n}\r\n\r\n#construct a centered header\r\n$MonthYear = \"{0:MMMM yyyy}\" -f $Date\r\n$pad = ($days.Length\/2) + ($Monthyear.length\/2)\r\n$title = $monthYear.PadLeft($pad)\r\n\r\n#define a here string for the final calendar output\r\n$myCal=@\"\r\n\r\n$title\r\n$days\r\n$($week1 -join \" \")`n\r\n\"@\r\n\r\n#process the rest of the weeks\r\nfor ($k=2;$k -le 5;$k++ ) {\r\n #initialize an array for a week of days\r\n $wkArray = @()\r\n for ($i = 0; $i -le 6; $i++) { \r\n  #get the next day\r\n  $nextday = $firstday.AddDays($j)\r\n\r\n  #test if we are still in the same month\r\n  if ($nextday.Month -eq $firstday.month) {\r\n    #add the padded day to the array\r\n    $wkArray+= $nextday.day.ToString().PadLeft(3)\r\n    $j++\r\n  } \r\n  else {\r\n    #new month so break out of the inner For loop\r\n    Break\r\n  }\r\n }\r\n #join each element of the array into a single line\r\n #and add to the calendar string\r\n $myCal+= \"$($wkArray -join \" \")`n\"\r\n}\r\n\r\n#write out as separate lines which makes it easier to save to a file\r\n$mycal.Split(\"`n\")\r\n\r\n} #end function\r\n\r\nSet-Alias -Name gcal -Value Get-Calendar<\/pre>\n<p>The script will define an alias, gcal, for the function.<\/p>\n<p>Because calendars are culture (i.e. language) specific, I wanted to write something that anyone could use, and not something just for North American users. That meant retrieving culture settings so I could use language specific versions of days of the week. I think. It is very hard to fully test this without a system running completely in a different culture. <\/p>\n<p>I wanted my calendar to display abbreviated week day names in the correct culture.<\/p>\n<pre class=\"lang:ps decode:true \" >$cult = Get-Culture\r\n$cal = $cult.Calendar\r\n$ui = Get-UICulture\r\n\r\n$daysOfWeek = $ui.DateTimeFormat.AbbreviatedDayNames<\/pre>\n<p>After quite a bit of experimenting, I realized the best way to create the calendar was to write each line as a separate string. This meant one line would be the abbreviated week day names.<\/p>\n<pre class=\"lang:ps decode:true \" >#create a string with the days of the week\r\n$days = $DaysOfWeek -join \" \"<\/pre>\n<p>Then each week would be a string of numbers. But this was the tricky part. It was easy enough to find out how many days were in the month, and what the first day of the month would be.<\/p>\n<pre class=\"lang:ps decode:true \" >$intDays = $cal.GetDaysInMonth($Date.year,$Date.month)\r\n\r\n#get the first day of the month\r\n[datetime]$firstday = $Date.addDays(-$Date.Day+1)<\/pre>\n<p>Here's the challenge: I can figure out that the first day of the month might be on a Thursday. Which means I need to align '1' under the THU heading, and then add enough other days until I reach the end of the week.<\/p>\n<pre class=\"lang:ps decode:true \" >$week1=@()\r\nfor ($i=0;$i -lt 7;$i++) {\r\nif ((\"{0:ddd}\" -f $firstday) -eq $ui.DateTimeFormat.AbbreviatedDayNames[$i] ) {\r\n  #I am assuming all short day abbreviations will be 3 characters\r\n  $week1+=$firstday.Day.ToString().PadLeft(3)\r\n  #got the date so move on\r\n  break\r\n}\r\nelse {\r\n #add an empty day\r\n $week1+=\"   \"\r\n} \r\n}<\/pre>\n<p>So I created an array, $Week1, to hold a set of values. I use a FOR loop to check if the date's short day name matches the array of abbreviated day names from the UI culture, I know that is the first day of the month. Otherwise, I simply add a 2 space \"filler\" to the array. Then I need to add the rest of the days for the first week.<\/p>\n<pre class=\"lang:ps decode:true \" >#fill out the rest of the week\r\n$j = 1\r\n#loop through until we reach the end of the week\r\nwhile ($i -le 5) {\r\n    $week1+=$firstday.AddDays($j).day.ToString().PadLeft(3)\r\n    $i++\r\n    $j++\r\n}<\/pre>\n<p>With that, I can begin constructing a text representation of the calendar using a here string.<\/p>\n<pre class=\"lang:ps decode:true \" >#define a here string for the final calendar output\r\n$myCal=@\"\r\n\r\n$title\r\n$days\r\n$($week1 -join \" \")`n\r\n\"@<\/pre>\n<p>The clever part is using the -Join operator to essentially concatenate all of the values in the week 1 array, separating each by a space. From here, I repeat the process for each week until I reach the end of the month.<\/p>\n<p>At the end of the process $mycal is a here string with the calendar. I could simply write $mycal to the pipeline and it would look just fine. However, because you might want to save the calendar to a text file, I found it best to split the here string back into an array.<\/p>\n<pre class=\"lang:ps decode:true \" >#write out as separate lines which makes it easier to save to a file\r\n$mycal.Split(\"`n\")<\/pre>\n<p>Now you can create a text file calendar for next year:<\/p>\n<pre class=\"lang:ps decode:true \" >1..12 | foreach {get-calendar \"$_\/1\/2015\"} | Out-file c:\\work\\2015.txt<\/pre>\n<p>Or run the command at the prompt.<br \/>\n<a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar-300x276.png\" alt=\"get-calendar\" width=\"300\" height=\"276\" class=\"aligncenter size-medium wp-image-4032\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar-300x276.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The function defaults to the current month or you can specify any date. You can even write it to the host and add a little color.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar2-300x71.png\" alt=\"get-calendar2\" width=\"300\" height=\"71\" class=\"aligncenter size-medium wp-image-4033\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar2-300x71.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar2-1024x242.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/get-calendar2.png 1258w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If you run PowerShell under something other than en-US, I'd love to hear how this works for you. Hope you have a little bit of fun with this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s Friday Fun I think epitomizes how much I think about PowerShell. But I also think it will serve as a useful learning device if not something you might actually want to use. For some reason, I thought it would be useful to quickly display a monthly calendar in PowerShell. Sure, I could click&#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":"Fresh Friday Fun - Does Anyone Really Know What Day It Is? http:\/\/bit.ly\/1wvyVDX  #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,8],"tags":[477,568,534,540],"class_list":["post-4030","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","category-scripting","tag-culture","tag-friday-fun","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun - Does Anyone Really Know What Day It Is? &#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\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun - Does Anyone Really Know What Day It Is? &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"This week&#039;s Friday Fun I think epitomizes how much I think about PowerShell. But I also think it will serve as a useful learning device if not something you might actually want to use. For some reason, I thought it would be useful to quickly display a monthly calendar in PowerShell. Sure, I could click...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-19T13:34:18+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/eternalclock_150x150.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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun &#8211; Does Anyone Really Know What Day It Is?\",\"datePublished\":\"2014-09-19T13:34:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/\"},\"wordCount\":581,\"commentCount\":19,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/12\\\/eternalclock_150x150.png\",\"keywords\":[\"Culture\",\"Friday Fun\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/\",\"name\":\"Friday Fun - Does Anyone Really Know What Day It Is? &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/12\\\/eternalclock_150x150.png\",\"datePublished\":\"2014-09-19T13:34:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/#primaryimage\",\"url\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/12\\\/eternalclock_150x150.png\",\"contentUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/12\\\/eternalclock_150x150.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4030\\\/friday-fun-does-anyone-really-know-what-day-it-is\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun &#8211; Does Anyone Really Know What Day It Is?\"}]},{\"@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 - Does Anyone Really Know What Day It Is? &#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\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun - Does Anyone Really Know What Day It Is? &#8226; The Lonely Administrator","og_description":"This week's Friday Fun I think epitomizes how much I think about PowerShell. But I also think it will serve as a useful learning device if not something you might actually want to use. For some reason, I thought it would be useful to quickly display a monthly calendar in PowerShell. Sure, I could click...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/","og_site_name":"The Lonely Administrator","article_published_time":"2014-09-19T13:34:18+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/eternalclock_150x150.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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun &#8211; Does Anyone Really Know What Day It Is?","datePublished":"2014-09-19T13:34:18+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/"},"wordCount":581,"commentCount":19,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/eternalclock_150x150.png","keywords":["Culture","Friday Fun","PowerShell","Scripting"],"articleSection":["Friday Fun","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/","name":"Friday Fun - Does Anyone Really Know What Day It Is? &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/eternalclock_150x150.png","datePublished":"2014-09-19T13:34:18+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/#primaryimage","url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/eternalclock_150x150.png","contentUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/eternalclock_150x150.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4030\/friday-fun-does-anyone-really-know-what-day-it-is\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun &#8211; Does Anyone Really Know What Day It Is?"}]},{"@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":3377,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3377\/friday-fun-get-day-of-the-year-with-powershell\/","url_meta":{"origin":4030,"position":0},"title":"Friday Fun: Get Day of the Year with PowerShell","author":"Jeffery Hicks","date":"August 30, 2013","format":false,"excerpt":"Earlier this week I was having some fun with @EnergizedTech on Twitter, playing around with dates in PowerShell. I'm not even sure where we started but the experience got me thinking and it's Friday so let's have some fun. While I can easily find out what the day of the\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"calendar","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/08\/calendar.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6101,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6101\/powershell-calendaring-revisited\/","url_meta":{"origin":4030,"position":1},"title":"PowerShell Calendaring Revisited","author":"Jeffery Hicks","date":"September 28, 2018","format":false,"excerpt":"Early this week, I came across an old snippet of code in my scripts folder, originally published by Lee Holmes. It was an old script, from 2008, on using PowerShell to display a calendar with out of office information.\u00a0 I seem to recall that I had been trying to do\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\/2018\/09\/show-calendar-2_thumb.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/show-calendar-2_thumb.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/show-calendar-2_thumb.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/show-calendar-2_thumb.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7212,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7212\/adding-a-powershell-profile-calendar\/","url_meta":{"origin":4030,"position":2},"title":"Adding a PowerShell Profile Calendar","author":"Jeffery Hicks","date":"February 1, 2020","format":false,"excerpt":"Some of you may be aware of my PSCalendar module which you can install from the PowerShell Gallery. The module contains commands that you can use to display a console-based calendar.\u00a0 The calendar commands let you specify days to highlight. These might be days with special events or appointments. I\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\/2020\/02\/image_thumb-2.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-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/02\/image_thumb-2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4169,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4169\/friday-fun-updated-ise-scripting-geek-module\/","url_meta":{"origin":4030,"position":3},"title":"Friday Fun: Updated ISE Scripting Geek Module","author":"Jeffery Hicks","date":"January 9, 2015","format":false,"excerpt":"A few years ago I published a module with a number of functions and enhancements for the PowerShell ISE. This ISEScriptingGeek module has remained popular over the last few years. But I wrote it for PowerShell v2. I have also come up with a number of new additions to the\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"geek","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/01\/geek-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4923,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/4923\/friday-fun-tweaking-the-powershell-ise\/","url_meta":{"origin":4030,"position":4},"title":"Friday Fun: Tweaking the PowerShell ISE","author":"Jeffery Hicks","date":"February 19, 2016","format":false,"excerpt":"Today's fun is still PowerShell related, but instead of something in the console, we'll have some fun with the PowerShell ISE. One of the things I love about the PowerShell ISE is that you can customize it and extend it.\u00a0 My ISE Scripting Geek project is an example.\u00a0 But today\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-12.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4895,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4895\/friday-fun-a-sysinternals-powershell-workflow\/","url_meta":{"origin":4030,"position":5},"title":"Friday Fun: A SysInternals PowerShell Workflow","author":"Jeffery Hicks","date":"February 12, 2016","format":false,"excerpt":"Over the years I've come up with a number of PowerShell tools to download the SysInternals tools to my desktop. And yes, I know that with PowerShell 5 and PowerShellGet I could download and install a SysInternals package. But that assumes the package is current.\u00a0 But that's not really the\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-5.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-5.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-5.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4030","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=4030"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4030\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}