{"id":3584,"date":"2013-12-20T10:09:54","date_gmt":"2013-12-20T15:09:54","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3584"},"modified":"2013-12-20T10:09:54","modified_gmt":"2013-12-20T15:09:54","slug":"friday-fun-a-christmas-present-for-you","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/","title":{"rendered":"Friday Fun: A Christmas Present for You"},"content":{"rendered":"<p>Over the years a number of people in the PowerShell community have shared Christmas and holiday related items. I've collected them and in some cases tweaked a little bit. This year I decided to wrap them all up in a module for you. This will work in PowerShell 2.0 and later.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 2.0\r\n\r\n&lt;#\r\nChristmas.psm1\r\n\r\nA PowerShell module with a collection of holiday themed functions.\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#&gt;\r\n\r\nFunction Start-Jingle {\r\n\r\nParam ([switch]$FullSong)\r\n\r\n#The first number is the reciprocal of the duration and the rest is the \r\n#note and octave (which we use for getting the frequency).  \r\n#For example, 4A4 is a quarter A note\r\n\r\nif ($fullSong) {\r\n$notes = write `\r\n  4A4 4A4 2A4        4A4 4A4 2A4        4A4 4C4 4F3 8G3             1A4 `\r\n  4Bb4 4Bb4 4Bb4 8Bb4     4Bb4 4A4 4A4 8A4 8A4    4A4 4G3 4G3 4A4    2G3 2C4 `\r\n  4A4 4A4 2A4       4A4 4A4 2A4    4A4 4C4 4F3 4G3     1A4        4Bb4 4Bb4 4Bb4 4Bb4 `\r\n  4Bb4 4A4 4A4 8A4 8A4    4C4 4C4 4Bb4 4G3     1F3     4C3 4A4 4G3 4F3     2C3 8C3 8C3  `\r\n  4C3 4A4 4G3 4F3       1D3      4D3 4Bb4 4A4 4G3     '1E3'    4C4 4C4 4Bb4 4G3 `\r\n  1A4     4C3 4A4 4G3 4F3    1C3     4C3 4A4 4G3 4F3     1D3 `\r\n  4D3 4Bb3 4A4 4G3         4C4 4C4 4C4 8C4 8C4    4D4 4C4 4Bb4 4G3    4F3 2C4   4A4 4A4 2A4 `\r\n  4A4 4A4 2A4      4A4 4C4 4C3 8G3      1A4     4Bb4 4Bb4 4Bb4 8Bb4      4Bb4 4A4 4A4 8A4 8A4 `\r\n  4A4 4G3 4G3 4A4       2G3 2C4     4A4 4A4 2A4     4A4 4A4 2A4    4A4 4C4 4F3 8G3 `\r\n  1A4       4Bb4 4Bb4 4Bb4 4Bb4      4Bb4 4A4 4A4 8A4 8A4      4C4 4C4 4Bb4 4G3     1F3\r\n} else {\r\n#first verse only\r\n$notes =  write 4A4 4A4 2A4        4A4 4A4 2A4        4A4 4C4 4F3 8G3             1A4 `\r\n  4Bb4 4Bb4 4Bb4 8Bb4     4Bb4 4A4 4A4 8A4 8A4    4A4 4G3 4G3 4A4    2G3 2C4 `\r\n  4A4 4A4 2A4       4A4 4A4 2A4    4A4 4C4 4F3 4G3     1A4        4Bb4 4Bb4 4Bb4 4Bb4 `\r\n  4Bb4 4A4 4A4 8A4 8A4    4C4 4C4 4Bb4 4G3     1F3  \r\n\r\n}\r\n\r\nfunction Play([int] $freq, [int] $duration)\r\n{\r\n  [console]::Beep($freq, $duration);\r\n}\r\n \r\n#\r\n# Note is given by fn=f0 * (a)^n\r\n# a is the twelth root of 2\r\n# n is the number of half steps from f0, positive or negative.\r\n# f0 used here is A4 at 440 Hz\r\n#\r\n$f0 = 440;\r\n$a = [math]::pow(2,(1\/12)); # Twelth root of 2\r\nfunction GetNoteFreq([string]$note)\r\n{\r\n  # n is the number of half steps from the fixed note.\r\n  $note -match '([A-G#]{1,2})(\\d+)' | out-null\r\n  $octave = ([int] $matches[2]) - 4;\r\n  $n = $octave * 12 + ( GetHalfStepsFromA $matches[1] );\r\n  $freq = $f0 * [math]::Pow($a, $n);\r\n\r\n  return $freq;\r\n}\r\n\r\n \r\nfunction GetHalfStepsFromA([string] $note)\r\n{\r\n  switch($note)\r\n  {\r\n    'A'  { 0 }\r\n    'A#' { 1 }\r\n    'Bb' { 1 }\r\n    'B'  { 2 }\r\n    'C'  { 3 }\r\n    'C#' { 4 }\r\n    'Db' { 4 }\r\n    'D'  { 5 }\r\n    'D#' { 6 }\r\n    'Eb' { 6 }\r\n    'E'  { 7 }\r\n    'F'  { 8 }\r\n    'F#' { 9 }\r\n    'Gb' { 9 }\r\n    'G'  { 10 }\r\n    'G#' { 11 }\r\n    'Ab' { 11 }\r\n  }\r\n}\r\n\r\n\r\n$StandardDuration = 1000;\r\nforeach($note in $notes)\r\n{\r\n\r\n  $note -match '(\\d)(.+)' | out-null\r\n  $duration = $StandardDuration \/ ([int] $matches[1]);\r\n  $playNote = $matches[2];\r\n  $freq = GetNoteFreq $playNote;\r\n\r\n  #write-host $playNote $freq $duration;\r\n Play $freq $duration\r\n  start-sleep -milli 50\r\n}\r\n\r\n} #end Start-Jingle\r\n\r\nFunction New-Tree {\r\n\r\nParam([string]$Caption=\"Happy Holidays from PowerShell\")\r\n\r\ncls\r\nwrite-host \"`n\"\r\n\r\n$Peek = \" ^ \"\r\n$tree = \"\/|\\\"\r\n$i = 20 \r\n$pos = $host.ui.rawui.CursorPosition\r\nwrite-host -fore 'Red' ($peek.PadLeft($i -1).PadRight(36) * 2)\r\nwrite-host -fore 'green' ($tree.PadLeft($i -1).PadRight(36) * 2)\r\n1..16 |% {\r\n    $tree = $tree -replace \"\/(.*)\\\\\",'\/\/$1\\\\'\r\n    write-host -fore 'green' ($tree.PadLeft($i).PadRight(36) * 2)\r\n    $i++\r\n}\r\n\r\nwrite-host -fore 'green' (\"|||\".PadLeft(19).PadRight(36) *2 )\r\nwrite-host -fore 'green' (\"|||\".PadLeft(19).PadRight(36) *2)\r\n\r\n$rect = New-Object System.Management.Automation.Host.Rectangle\r\n$rect.top = $pos.y\r\n$rect.Right = 70\r\n$rect.Bottom = $pos.y + 19\r\n$buffer = $host.ui.rawui.getbuffercontents($rect)\r\n$R = New-Object system.random\r\n$ball = New-Object System.Management.Automation.Host.BufferCell\r\n$ball.Character = '@'\r\n$ball.backgroundColor = $host.ui.rawui.BackgroundColor\r\n\r\n1..120 |% {\r\n    sleep -m 120\r\n    $rx = $r.Next(19)\r\n    $ry = $r.Next(70)\r\n    $ball.ForegroundColor = $r.next(16)\r\n\r\n    if ($buffer[$rx,$ry].Character -eq '\/') {$buffer[$rx,$ry] = $ball}\r\n    if ($buffer[$rx,$ry].Character -eq '\\') {$buffer[$rx,$ry] = $ball}\r\n    $host.ui.rawui.SetBufferContents($pos,$buffer)\r\n}\r\n\r\nWrite-Host \"`n$([char]14) **$Caption** $([char]14) `n\" -ForegroundColor Red\r\n\r\n\r\n} #end New-Tree\r\n\r\nFunction Get-Greeting {\r\ncls\r\n\r\n$XmasMsg =\r\n@\"\r\n.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:.\r\n.     *                                       .\r\n.    \/.\\        Merry Christmas               .\r\n.   \/..'\\            from all of us           .\r\n.   \/'.'\\                in PowerShell        .\r\n.  \/.''.'\\                                    .\r\n.  \/.'.'.\\                                    .\r\n. \/'.''.'.\\                                   .\r\n. ^^^[_]^^^                                   .\r\n.                                             .\r\n.                                             .\r\n.                                          .\r\n.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:.\r\n\"@\r\n\r\nWrite-Host -ForegroundColor Green $XmasMsg\r\nStart-Sleep 5\r\n$Msg1 =\r\n@\"\r\n                    _...\r\n              o_.-\"`    `\\\r\n       .--.  _ `'-._.-'\"\"-;     _\r\n     .'    \\`_\\_  {_.-a\"a-}  _ \/ \\\r\n   _\/     .-'  '. {c-._o_.){\\|`  |\r\n  (@`-._ \/       \\{    ^  } \\\\ _\/\r\n   `~\\  '-._      \/'.     }  \\}  .-.\r\n     |&gt;:&lt;   '-.__\/   '._,} \\_\/  \/ ())  \r\n     |     &gt;:&lt;   `'---. ____'-.|(`\"`\r\n     \\            &gt;:&lt;  \\\\_\\\\_\\ | ;\r\n      \\                 \\\\-{}-\\\/  \\\r\n       \\                 '._\\\\'   \/)\r\n        '.                       \/(\r\n          `-._ _____ _ _____ __.'\\ \\\r\n            \/ \\     \/ \\     \/ \\   \\ \\ \r\n         _.'\/^\\'._.'\/^\\'._.'\/^\\'.__) \\\r\n     ,=='  `---`   '---'   '---'      )\r\n     `\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"`\r\n\"@\r\n\r\n$msg2 = \r\n@\"\r\n               ___\r\n             \/`   `'.\r\n            \/   _..---;\r\n            |  \/__..._\/  .--.-.\r\n            |.'  e e | ___\\_|\/____\r\n           (_)'--.o.--|    | |    |\r\n          .-( `-' = `-|____| |____|\r\n         \/  (         |____   ____|\r\n         |   (        |_   | |  __|\r\n         |    '-.--';\/'\/__ | | (  `|\r\n         |      '.   \\    )\"\";--`\\ \/\r\n         \\        ;   |--'    `;.-'\r\n         |`-.__ ..-'--'`;..--'`\r\n\"@\r\n\r\n$msg3 = \r\n@\"\r\n           *             ,\r\n                       _\/^\\_\r\n                      &lt;     &gt;\r\n     *                 \/.-.\\         *\r\n              *        `\/&amp;\\`                   *\r\n                      ,@.*;@,\r\n                     \/_o.I %_\\    *\r\n        *           (`'--:o(_@;\r\n                   \/`;--.,__ `')             *\r\n                  ;@`o % O,*`'`&amp;\\ \r\n            *    (`'--)_@ ;o %'()\\      *\r\n                 \/`;--._`''--._O'@;\r\n                \/&amp;*,()~o`;-.,_ `\"\"`)\r\n     *          \/`,@ ;+&amp; () o*`;-';\\\r\n               (`\"\"--.,_0 +% @' &amp;()\\\r\n               \/-.,_    ``''--....-'`)  *\r\n          *    \/@%;o`:;'--,.__   __.'\\\r\n              ;*,&amp;(); @ % &amp;^;~`\"`o;@();         *\r\n              \/(); o^~; &amp; ().o@*&amp;`;&amp;%O\\\r\n              `\"=\"==\"\"==,,,.,=\"==\"===\"`\r\n           __.----.(\\-''#####---...___...-----._\r\n         '`         \\)_`\"\"\"\"\"`\r\n                 .--' ')\r\n               o(  )_-\\\r\n                 `\"\"\"` `\r\n \r\n\"@\r\n\r\n$msg4 =\r\n@\"\r\n                        .--------.\r\n   *               .    |________|        .          *\r\n                        |      __|\/\\\r\n             *        .-'======\\_\\o\/.\r\n                     \/___________&lt;&gt;__\\\r\n               ||||||  \/  (o) (o)  \\\r\n               |||||| |   _  O  _   |          .\r\n     .         |||||| |  (_)   (_)  |\r\n               ||||||  \\   '---'   \/    *\r\n               \\====\/   [~~~~~~~~~]\r\n                \\\\\/\/  _\/~||~`|~~~~~\\_\r\n                _||-'`\/  ||  |      \\`'-._       *\r\n        *    .-` )|  ;   ||  |)      ;    '. \r\n            \/    `--.|   ||  |       |      `\\\r\n           |         \\   |||||)      |-,      \\         .\r\n            \\       .;       _       ; |_,    |\r\n             `'''||` ,\\     (_)     \/,    `.__\/\r\n                 ||.`  '.         .'  `.             *\r\n      *          ||       ` ' ' `       \\\r\n                 ||                      ;\r\n   .          *  ||                      |    .\r\n                 ||                      |              *\r\n                 ||                      |\r\n .__.-\"\"-.__.-\"\"\"||                      ;.-\"\"\"-.__.-\"\"-.__.\r\n                 ||                     \/\r\n                 ||'.                 .'\r\n                 ||  '-._  _ _  _ _.-'\r\n                `\"\"`       \r\n\"@\r\n$msg5 =\r\n@\"\r\n                                  _\r\n                               .-(_)\r\n                              \/ _\/\r\n                           .-'   \\\r\n                          \/       '.\r\n                        ,-~--~-~-~-~-,\r\n                       {__.._...__..._}             ,888,\r\n       ,888,          \/\\##\"  6  6  \"##\/\\          ,88' `88,\r\n     ,88' '88,__     |(\\`    (__)    `\/)|     __,88'     `88\r\n    ,88'   .8(_ \\_____\\_    '----'    _\/_____\/ _)8.       8'\r\n    88    (___)\\ \\      '-.__    __.-'      \/ \/(___)\r\n    88    (___)88 |          '--'          | 88(___)\r\n    8'      (__)88,___\/                \\___,88(__)\r\n              __`88,_\/__________________\\_,88`__\r\n             \/    `88,       |88|       ,88'    \\\r\n            \/        `88,    |88|    ,88'        \\\r\n           \/____________`88,_\\88\/_,88`____________\\\r\n          \/88888888888888888;8888;88888888888888888\\\r\n         \/^^^^^^^^^^^^^^^^^^`\/88\\\\^^^^^^^^^^^^^^^^^^\\\r\n        \/                    |88| \\============,     \\\r\n       \/_  __  __  __   _ __ |88|_|^  MERRY    | _ ___\\\r\n       |;:.                  |88| | CHRISTMAS! |      |\r\n       |;;:.                 |88| '============'      |\r\n       |;;:.                 |88|                     |\r\n       |::.                  |88|                     |\r\n       |;;:'                 |88|                     |\r\n       |:;,                  |88|                     |\r\n       '---------------------\"\"\"\"---------------------'\r\n\"@\r\n\r\nFor($i = 1; $i -le 5; $i++) {\r\n\tIf([bool]!($i%2)) {\r\n\t\tWrite-Host -ForegroundColor Green (Get-Content Variable:msg$i)\r\n        \r\n\t\t} else {\r\n\t\tWrite-Host -ForegroundColor Red (Get-Content Variable:msg$i)\r\n\t\t}\r\n    Start-Sleep -Seconds 3\r\n} #for\r\n} #end Get-Greeting\r\n\r\nFunction Get-Holiday {\r\n\r\n#get start-jingle script block\r\n$sb = (dir function:start-jingle).scriptblock\r\nstart-job -ScriptBlock $sb -Name JingleJob | out-null\r\nstart-sleep -Seconds 2\r\n\r\nNew-Tree\r\n\r\nWait-Job -Name JingleJob | Remove-Job\r\n\r\n} #end Get-Holiday\r\n\r\nFunction Prompt {\r\n\r\n$today = Get-Date\r\n#test if today is Christmas\r\nif ($today.Month -eq 12 -AND $today.day -eq 25) {\r\n    $text = \"Merry Christmas!\"\r\n} \r\nelse {\r\n\r\n    $currYr = $Today.Year\r\n    $xmas = [datetime]\"12\/25\/$currYr\"\r\n    #test if Christmas has passed for this year.\r\n    if ($today -gt $xmas) {\r\n      $xmas = $xmas.AddYears(1)\r\n    }\r\n\r\n    $tspan = ($xmas-$today).ToString()\r\n    #strip off ms\r\n    $time=$tspan.substring(0,$tspan.LastIndexOf(\".\"))\r\n    $text=\"[**~Christmas in $($time)~**]\"\r\n}\r\n\r\n#write each character in a different color\r\n$text.tocharArray() | foreach {\r\nif ((Get-Random -min 1 -max 10) -gt 5) {\r\n $color=\"RED\"\r\n }\r\nelse {\r\n $color=\"GREEN\"\r\n}\r\nwrite-host $_ -nonewline -foregroundcolor $color\r\n}\r\nWrite (\" PS \" + (Get-Location) + \"&gt; \")\r\n} #end function\r\n\r\nExport-ModuleMember -function Start-Jingle,New-Tree,Get-Greeting,Get-Holiday,Prompt<\/pre>\n<p>As you look through the functions you can probably figure out what some of these functions do, but I don't want to spoil the surprise. But here's an example.<br \/>\n<a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas-300x146.png\" alt=\"xmas\" width=\"300\" height=\"146\" class=\"aligncenter size-medium wp-image-3585\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas-300x146.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas-624x303.png 624w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas.png 877w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Grab a copy of the module and look at the commands within it.<\/p>\n<pre class=\"lang:ps decode:true \" >get-command -module Christmas<\/pre>\n<p>Don't need to run Prompt because it automatically will run when you load the module. Note that if you remove the module you won't get your old prompt back. Simply restart PowerShell.<\/p>\n<p>Hoping you have a happy and healthy holiday and a fantastic New Year.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the years a number of people in the PowerShell community have shared Christmas and holiday related items. I&#8217;ve collected them and in some cases tweaked a little bit. This year I decided to wrap them all up in a module for you. This will work in PowerShell 2.0 and later. #requires -version 2.0 &lt;#&#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":"Friday Fun: A #PowerShell Christmas Present for You","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":[446,568,224,221,534,540],"class_list":["post-3584","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","category-scripting","tag-christmas","tag-friday-fun","tag-function","tag-module","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: A Christmas Present for You &#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\/3584\/friday-fun-a-christmas-present-for-you\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: A Christmas Present for You &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Over the years a number of people in the PowerShell community have shared Christmas and holiday related items. I&#039;ve collected them and in some cases tweaked a little bit. This year I decided to wrap them all up in a module for you. This will work in PowerShell 2.0 and later. #requires -version 2.0 &lt;#...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2013-12-20T15:09:54+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas-300x146.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\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: A Christmas Present for You\",\"datePublished\":\"2013-12-20T15:09:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/\"},\"wordCount\":149,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/12\\\/xmas-300x146.png\",\"keywords\":[\"Christmas\",\"Friday Fun\",\"Function\",\"module\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/\",\"name\":\"Friday Fun: A Christmas Present for You &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/12\\\/xmas-300x146.png\",\"datePublished\":\"2013-12-20T15:09:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/12\\\/xmas.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/12\\\/xmas.png\",\"width\":877,\"height\":427},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3584\\\/friday-fun-a-christmas-present-for-you\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: A Christmas Present for You\"}]},{\"@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: A Christmas Present for You &#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\/3584\/friday-fun-a-christmas-present-for-you\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: A Christmas Present for You &#8226; The Lonely Administrator","og_description":"Over the years a number of people in the PowerShell community have shared Christmas and holiday related items. I've collected them and in some cases tweaked a little bit. This year I decided to wrap them all up in a module for you. This will work in PowerShell 2.0 and later. #requires -version 2.0 &lt;#...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/","og_site_name":"The Lonely Administrator","article_published_time":"2013-12-20T15:09:54+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas-300x146.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\/3584\/friday-fun-a-christmas-present-for-you\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: A Christmas Present for You","datePublished":"2013-12-20T15:09:54+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/"},"wordCount":149,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas-300x146.png","keywords":["Christmas","Friday Fun","Function","module","PowerShell","Scripting"],"articleSection":["Friday Fun","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/","name":"Friday Fun: A Christmas Present for You &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas-300x146.png","datePublished":"2013-12-20T15:09:54+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/xmas.png","width":877,"height":427},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3584\/friday-fun-a-christmas-present-for-you\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: A Christmas Present for You"}]},{"@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":4169,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4169\/friday-fun-updated-ise-scripting-geek-module\/","url_meta":{"origin":3584,"position":0},"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":4061,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4061\/friday-fun-lets-play-a-game\/","url_meta":{"origin":3584,"position":1},"title":"Friday Fun &#8211; Let&#8217;s Play a Game","author":"Jeffery Hicks","date":"October 3, 2014","format":false,"excerpt":"Today is going to be a lot of fun. A few years ago, back when we were still running PowerShell 2.0 everywhere, I created a module to run a Bingo game in a PowerShell session. I primarily wrote the module as a learning tool for beginners wanting to know more\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"BingoCard-small","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/10\/BingoCard-small.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4713,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4713\/a-festive-christmas-message\/","url_meta":{"origin":3584,"position":2},"title":"A Festive Christmas Message","author":"Jeffery Hicks","date":"December 24, 2015","format":false,"excerpt":"The year is winding down and it is getting harder and harder to remain productive.\u00a0 So I'm trying to combine having some fun while still trying to help you learn PowerShell. I wrote a simple PowerShell script that randomly selects a Christmas themed quote and displays in a colorful fashion.\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"A Christmas Message","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/image_thumb-8.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/image_thumb-8.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/image_thumb-8.png?resize=525%2C300 1.5x"},"classes":[]},{"id":4155,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4155\/friday-fun-another-christmas-prompt\/","url_meta":{"origin":3584,"position":3},"title":"Friday Fun: Another Christmas Prompt","author":"Jeffery Hicks","date":"December 12, 2014","format":false,"excerpt":"In last week's Friday Fun post, I shared with you a PowerShell prompt that would display a festive Christmas countdown clock. This week I have another holiday related prompt function. This one is pretty straight forward and is not that much different from the default PowerShell prompt function. Function Prompt\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"christmastree","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/12\/christmastree.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":5319,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5319\/a-classy-christmas-powershell-module\/","url_meta":{"origin":3584,"position":4},"title":"A Classy Christmas PowerShell Module","author":"Jeffery Hicks","date":"December 20, 2016","format":false,"excerpt":"Yesterday I showed you a class-based PowerShell script. My intention was to have a little bit of fun and teach you the basics of using a class. But what I gave you was really just the first step. If you wanted to create an actual tool around a class, you\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\/2016\/12\/christmas-wreath13.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6175,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6175\/more-fun-with-powershell-thrillers\/","url_meta":{"origin":3584,"position":5},"title":"More Fun with PowerShell Thrillers","author":"Jeffery Hicks","date":"November 20, 2018","format":false,"excerpt":"Last week I posted a Friday Fun article about using PowerShell to create a synopsis for a hypothetical thriller novel. Naturally I wasn't satisfied to leave it at that. Don't get me wrong, it was a good start. But I needed to take the next logical step. I had a\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\/2018\/11\/image_thumb-6.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-6.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-6.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-6.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3584","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=3584"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3584\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}