{"id":7956,"date":"2020-12-11T11:19:51","date_gmt":"2020-12-11T16:19:51","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=7956"},"modified":"2020-12-11T11:19:57","modified_gmt":"2020-12-11T16:19:57","slug":"friday-fun-a-powershell-christmas-prompt","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/","title":{"rendered":"Friday Fun &#8211; A PowerShell Christmas Prompt"},"content":{"rendered":"\n<p>Time for a new Friday Fun article. These articles use \"fun\" ways to teach you how to use PowerShell. The end goal may be silly, but hopefully the techniques and concepts are useful. Today I have an updated prompt function. You can customize your PowerShell prompt by creating a function called <em>prompt <\/em>and loading it into your PowerShell session.<\/p>\n\n\n\n<p>The prompt function only lasts for as long as your PowerShell session is running. Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">get-content function:prompt<\/code><\/pre>\n\n\n\n<p>to see your current prompt.<\/p>\n\n\n\n<p>Because Christmas is coming, and given how 2020 has been, we might want something to brighten up our day. I have a PowerShell prompt function that gives you a Christmas countdown, wrapped in emojis and color.<\/p>\n\n\n\n<pre title=\"ChristmasPrompt.ps1\" class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\"><em>&lt;#<\/em>\n<em>display\u00a0a\u00a0colorful\u00a0Christmas\u00a0countdown\u00a0prompt<\/em>\n\n<em>\ud83c\udf84\ud83c\udf20\u00a0Christmas\u00a0in\u00a017.09:44:21\u00a0\u26c4\u2728\u00a0PS\u00a0C:\\scripts><\/em>\n\n<em>this\u00a0prompt\u00a0requires\u00a0a\u00a0TrueType\u00a0font<\/em>\n<em>you\u00a0would\u00a0put\u00a0this\u00a0in\u00a0your\u00a0profile\u00a0script\u00a0so\u00a0that\u00a0it<\/em>\n<em>only\u00a0runs\u00a0in\u00a0December\u00a01-24<\/em>\n\n<em>#><\/em>\n\nif\u00a0((Get-Date).Month\u00a0-eq\u00a012\u00a0-AND\u00a0(Get-Date).Day\u00a0-lt\u00a025)\u00a0{\n\u00a0\u00a0<em>#dot\u00a0source\u00a0the\u00a0emoji\u00a0script<\/em>\n\u00a0\u00a0.\u00a0C:\\scripts\\PSEmoji.ps1\n\n\u00a0\u00a0<em>#load\u00a0the\u00a0Christmas\u00a0prompt<\/em>\n\n\u00a0\u00a0Function\u00a0Prompt\u00a0{\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0current\u00a0year<\/em>\n\u00a0\u00a0\u00a0\u00a0$year\u00a0=\u00a0(Get-Date).year\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0a\u00a0timespan\u00a0between\u00a0Christmas\u00a0for\u00a0this\u00a0year\u00a0and\u00a0now<\/em>\n\n\u00a0\u00a0\u00a0\u00a0$time\u00a0=\u00a0[datetime]\"25\u00a0December\u00a0$year\"\u00a0-\u00a0(Get-Date)\n\u00a0\u00a0\u00a0\u00a0<em>#turn\u00a0the\u00a0timespan\u00a0into\u00a0a\u00a0string\u00a0and\u00a0strip\u00a0off\u00a0the\u00a0milliseconds<\/em>\n\u00a0\u00a0\u00a0\u00a0$timestring\u00a0=\u00a0$time.ToString().Substring(0,\u00a011)\n\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0random\u00a0string\u00a0of\u00a0decorative\u00a0characters<\/em>\n\u00a0\u00a0\u00a0\u00a0<em>#they\u00a0can\u00a0be\u00a0pasted\u00a0emojis\u00a0or\u00a0created\u00a0from\u00a0values<\/em>\n\u00a0\u00a0\u00a0\u00a0$Snow\u00a0=\u00a0\"\u2744\ufe0f\"\n\u00a0\u00a0\u00a0\u00a0<em>#\u00a0$snow\u00a0=\u00a0ConvertTo-Emoji\u00a00x2744<\/em>\n\u00a0\u00a0\u00a0\u00a0<em>#\u00a0$sparkles\u00a0=\u00a0\"\u2728\"<\/em>\n\u00a0\u00a0\u00a0\u00a0$sparkles\u00a0=\u00a0ConvertTo-Emoji\u00a00x2728\n\u00a0\u00a0\u00a0\u00a0<em>#$snowman\u00a0=\u00a0\"\u26c4\"<\/em>\n\u00a0\u00a0\u00a0\u00a0$snowman\u00a0=\u00a0ConvertTo-Emoji\u00a00x26C4\n\u00a0\u00a0\u00a0\u00a0$santa\u00a0=\u00a0ConvertTo-Emoji\u00a00x1F385\n\u00a0\u00a0\u00a0\u00a0$mrsClaus\u00a0=\u00a0ConvertTo-Emoji\u00a00x1F936\n\u00a0\u00a0\u00a0\u00a0$tree\u00a0=\u00a0ConvertTo-Emoji\u00a00x1F384\n\u00a0\u00a0\u00a0\u00a0$present\u00a0=\u00a0ConvertTo-Emoji\u00a00x1F381\n\u00a0\u00a0\u00a0\u00a0$notes\u00a0=\u00a0ConvertTo-Emoji\u00a00x1F3B5\n\u00a0\u00a0\u00a0\u00a0$bow\u00a0=\u00a0ConvertTo-Emoji\u00a00x1F380\n\u00a0\u00a0\u00a0\u00a0$star\u00a0=\u00a0ConvertTo-Emoji\u00a0127775\n\u00a0\u00a0\u00a0\u00a0$shootingStar\u00a0=\u00a0ConvertTo-Emoji\u00a0127776\n\u00a0\u00a0\u00a0\u00a0$myChars\u00a0=\u00a0$santa,\u00a0$mrsClaus,\u00a0$tree,\u00a0$present,\u00a0$notes,\u00a0$bow,\u00a0$star,\u00a0$shootingStar,\u00a0$snow,\u00a0$snowman,$sparkles\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0a\u00a0few\u00a0random\u00a0elements\u00a0for\u00a0the\u00a0prompt<\/em>\n\u00a0\u00a0\u00a0\u00a0$front\u00a0=\u00a0-join\u00a0($myChars\u00a0|\u00a0Get-Random\u00a0-Count\u00a02)\n\u00a0\u00a0\u00a0\u00a0$back\u00a0=\u00a0-join\u00a0($myChars\u00a0|\u00a0Get-Random\u00a0-Count\u00a02)\n\n\u00a0\u00a0\u00a0\u00a0<em>#the\u00a0text\u00a0to\u00a0display<\/em>\n\u00a0\u00a0\u00a0\u00a0$text\u00a0=\u00a0\"Christmas\u00a0is\u00a0coming\u00a0in\u00a0$timestring\"\n\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0each\u00a0character\u00a0in\u00a0the\u00a0text\u00a0and\u00a0randomly\u00a0assign\u00a0each\u00a0a\u00a0color\u00a0using\u00a0an\u00a0ANSI\u00a0sequence<\/em>\n\u00a0\u00a0\u00a0\u00a0$colorText\u00a0=\u00a0$text.tocharArray()\u00a0|\u00a0ForEach-Object\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$i\u00a0=\u00a0Get-Random\u00a0-Minimum\u00a01\u00a0-Maximum\u00a050\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0switch\u00a0($i)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a050\u00a0-AND\u00a0$i\u00a0-ge\u00a045\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;5;38;5;199m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a045\u00a0-AND\u00a0$i\u00a0-ge\u00a040\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;5;38;11;199m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a040\u00a0-AND\u00a0$i\u00a0-ge\u00a030\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;38;5;50m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a020\u00a0-and\u00a0$i\u00a0-gt\u00a015\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;5;38;5;1m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a016\u00a0-and\u00a0$i\u00a0-gt\u00a010\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;38;5;47m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a010\u00a0-and\u00a0$i\u00a0-gt\u00a05\u00a0}\u00a0\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;5;38;5;2m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0default\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;37m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"$seq$_$([char]0x1b)[0m\"\n\u00a0\u00a0\u00a0\u00a0}\u00a0<em>#foreach<\/em>\n\n\u00a0\u00a0\u00a0\u00a0<em>#write\u00a0the\u00a0prompt\u00a0text\u00a0to\u00a0the\u00a0host\u00a0on\u00a0its\u00a0own\u00a0line<\/em>\n\u00a0\u00a0\u00a0\u00a0Write-Host\u00a0\"$front\u00a0$($colortext\u00a0-join\u00a0'')\u00a0$back\"\u00a0<em>#-NoNewline\u00a0#-foregroundcolor\u00a0$color<\/em>\n\n\u00a0\u00a0\u00a0\u00a0<em>#the\u00a0function\u00a0needs\u00a0to\u00a0write\u00a0something\u00a0to\u00a0the\u00a0pipeline<\/em>\n\u00a0\u00a0\u00a0\u00a0\"PS\u00a0$($executionContext.SessionState.Path.CurrentLocation)$('>'\u00a0*\u00a0($nestedPromptLevel\u00a0+\u00a01))\u00a0\"\n\n\u00a0\u00a0}\u00a0<em>#end\u00a0function<\/em>\n\n}\u00a0<em>#If\u00a0December<\/em>\n\n<\/code><\/pre>\n\n\n\n<p>You can dot source the script file and if the date is between 12 December and Christmas, it will load a new prompt. The prompt will calculate a timespan indicating how long until Christmas.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">\u00a0\u00a0\u00a0\u00a0$year\u00a0=\u00a0(Get-Date).year\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0a\u00a0timespan\u00a0between\u00a0Christmas\u00a0for\u00a0this\u00a0year\u00a0and\u00a0now<\/em>\n\n\u00a0\u00a0\u00a0\u00a0$time\u00a0=\u00a0[datetime]\"25\u00a0December\u00a0$year\"\u00a0-\u00a0(Get-Date)\n\u00a0\u00a0\u00a0\u00a0<em>#turn\u00a0the\u00a0timespan\u00a0into\u00a0a\u00a0string\u00a0and\u00a0strip\u00a0off\u00a0the\u00a0milliseconds<\/em>\n\u00a0\u00a0\u00a0\u00a0$timestring\u00a0=\u00a0$time.ToString().Substring(0,\u00a011)<\/code><\/pre>\n\n\n\n<p>The rest of the function is embellishment around this text:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">\u00a0\u00a0\u00a0\u00a0<em>#the\u00a0text\u00a0to\u00a0display<\/em>\n\u00a0\u00a0\u00a0\u00a0$text\u00a0=\u00a0\"Christmas\u00a0is\u00a0coming\u00a0in\u00a0$timestring\"<\/code><\/pre>\n\n\n\n<p>I'm going to display emojis randomly chosen from an array of characters. You can either paste an emoji into your code or use my ConvertTo-Emoji function which converts the hex value.  The pasted emojis I'm using may not display properly here so I've included equivalents. Here's the script that is dot sourced in the prompt script.<\/p>\n\n\n\n<pre title=\"PSEmoji.ps1\" class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">\n<em>#These\u00a0commands\u00a0work\u00a0best\u00a0in\u00a0a\u00a0PowerShell\u00a0session\u00a0running\u00a0in\u00a0Windows\u00a0Terminal.<\/em>\n\n<em>#\u00a0http:\/\/www.unicode.org\/emoji\/charts\/full-emoji-list.html<\/em>\n\nFunction\u00a0ConvertTo-Emoji\u00a0{\n\u00a0\u00a0\u00a0\u00a0[cmdletbinding()]\n\u00a0\u00a0\u00a0\u00a0[alias(\"cte\")]\n\u00a0\u00a0\u00a0\u00a0Param(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[parameter(<em>Position<\/em>\u00a0=\u00a00,\u00a0<em>Mandatory<\/em>,\u00a0<em>ValueFromPipeline<\/em>,\u00a0<em>HelpMessage<\/em>\u00a0=\u00a0\"Specify\u00a0a\u00a0value\u00a0like\u00a00x1F499\u00a0or\u00a0128153\")]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[int]$Value\n\u00a0\u00a0\u00a0\u00a0)\n\u00a0\u00a0\u00a0\u00a0Process\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($env:wt_Session\u00a0-OR\u00a0($host.name\u00a0-match\u00a0\"studio\"))\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[char]::convertfromutf32($Value)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Warning\u00a0'This\u00a0command\u00a0is\u00a0only\u00a0supported\u00a0when\u00a0running\u00a0in\u00a0Windows\u00a0Terminal\u00a0at\u00a0this\u00a0time.'\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\n}\nFunction\u00a0Show-Emoji\u00a0{\n\u00a0\u00a0\u00a0\u00a0[cmdletbinding()]\n\u00a0\u00a0\u00a0\u00a0Param(\n\u00a0\u00a0\u00a0\u00a0[parameter(<em>Position<\/em>\u00a0=\u00a00,\u00a0<em>Mandatory<\/em>,<em>HelpMessage<\/em>\u00a0=\u00a0\"Enter\u00a0the\u00a0starting\u00a0Unicode\u00a0value\")]\n\u00a0\u00a0\u00a0\u00a0[int32]$Start,\n\u00a0\u00a0\u00a0\u00a0[Parameter(<em>HelpMessage<\/em>\u00a0=\u00a0\"How\u00a0many\u00a0items\u00a0do\u00a0you\u00a0want\u00a0to\u00a0display?\")]\n\u00a0\u00a0\u00a0\u00a0[int]$Count\u00a0=\u00a020\n\u00a0\u00a0\u00a0\u00a0)\n\u00a0\u00a0\u00a0\u00a0Write-verbose\u00a0\"Starting\u00a0at\u00a0$Start\u00a0and\u00a0getting\u00a0$count\u00a0items\"\n\u00a0\u00a0\u00a0\u00a0$counter\u00a0=\u00a01\n\n\u00a0\u00a0\u00a0\u00a0Do\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for\u00a0($i=1;$i\u00a0-le\u00a05;$i++)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0write-verbose\u00a0\"Counter\u00a0=\u00a0$counter\u00a0i\u00a0=\u00a0$i\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$item\u00a0=\u00a0\"{0}\u00a0{1}\u00a0\u00a0\"\u00a0-f\u00a0(ConvertTo-Emoji\u00a0($start)),$start\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($counter\u00a0-le\u00a0$count)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0write-host\u00a0$item\u00a0-NoNewline\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$counter++\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$start++\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0write-host\u00a0\"`r\"\n\u00a0\u00a0\u00a0\u00a0}\u00a0until\u00a0($counter\u00a0-ge\u00a0$count)\n}<\/code><\/pre>\n\n\n\n<p>The last part of the prompt is to take the string and display each character with an ANSI escape sequence. I've written the sequence so it will work in both Windows PowerShell and PowerShell 7.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">\u00a0\u00a0\u00a0<em>#get\u00a0each\u00a0character\u00a0in\u00a0the\u00a0text\u00a0and\u00a0randomly\u00a0assign\u00a0each\u00a0a\u00a0color\u00a0using\u00a0an\u00a0ANSI\u00a0sequence<\/em>\n\u00a0\u00a0\u00a0\u00a0$colorText\u00a0=\u00a0$text.tocharArray()\u00a0|\u00a0ForEach-Object\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$i\u00a0=\u00a0Get-Random\u00a0-Minimum\u00a01\u00a0-Maximum\u00a050\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0switch\u00a0($i)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a050\u00a0-AND\u00a0$i\u00a0-ge\u00a045\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;5;38;5;199m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a045\u00a0-AND\u00a0$i\u00a0-ge\u00a040\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;5;38;11;199m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a040\u00a0-AND\u00a0$i\u00a0-ge\u00a030\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;38;5;50m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a020\u00a0-and\u00a0$i\u00a0-gt\u00a015\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;5;38;5;1m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a016\u00a0-and\u00a0$i\u00a0-gt\u00a010\u00a0}\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;38;5;47m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0$i\u00a0-le\u00a010\u00a0-and\u00a0$i\u00a0-gt\u00a05\u00a0}\u00a0\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;5;38;5;2m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0default\u00a0{\u00a0$seq\u00a0=\u00a0\"$([char]0x1b)[1;37m\"\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"$seq$_$([char]0x1b)[0m\"\n\u00a0\u00a0\u00a0\u00a0}\u00a0<em>#foreach<\/em><\/code><\/pre>\n\n\n\n<p>Some of the sequences include blinking characters. The entire line of text is written to the host.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Write-Host\u00a0\"$front\u00a0$($colortext\u00a0-join\u00a0'')\u00a0$back\"<\/code><\/pre>\n\n\n\n<p>The prompt concludes using the default location code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">\"PS\u00a0$($executionContext.SessionState.Path.CurrentLocation)$('>'\u00a0*\u00a0($nestedPromptLevel\u00a0+\u00a01))\u00a0\"<\/code><\/pre>\n\n\n\n<p>Originally, I was using Write-Host with -NoNewLine so that the text preceded the location. But I like the look of it on its own line. Want to see?<\/p>\n\n\n\n<p>Save the files to the same directory and then dot source the prompt script.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">. c:\\scripts\\christmasprompt.ps1<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"606\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-1024x606.png\" alt=\"A PowerShell Christmas countdown prompt\" class=\"wp-image-7959\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-1024x606.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-300x178.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-768x455.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-1536x910.png 1536w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-2048x1213.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>Because the ANSI colors are random, you get something different every time hit Enter. The blinking characters make your prompt sparkle.<\/p>\n\n\n\n<p>Yes, this silly and has no practical purpose, unless you are a terrible procrastinator and need the reminder! But look at the PowerShell techniques: dot sourcing, switch, functions, sub-expressions,timespans, If statements. These are all things you will use in your real PowerShell work. If you are still learning PowerShell, sometimes it helps to see these things demonstrated in different ways.<\/p>\n\n\n\n<p>I hope you'll at least give the code a try. The prompt only lasts for as long as PowerShell is running so there's no risk. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Time for a new Friday Fun article. These articles use &#8220;fun&#8221; ways to teach you how to use PowerShell. The end goal may be silly, but hopefully the techniques and concepts are useful. Today I have an updated prompt function. You can customize your PowerShell prompt by creating a function called prompt and loading it&#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 Prompt","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":[628,641],"class_list":["post-7956","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-ansi","tag-emoji"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun - A PowerShell Christmas Prompt &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"Here&#039;s how I built an PowerShell prompt that countsdown Christmas and displays it with ANSI colors and emojis. A fun way to learn PowerShell.\" \/>\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\/7956\/friday-fun-a-powershell-christmas-prompt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun - A PowerShell Christmas Prompt &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Here&#039;s how I built an PowerShell prompt that countsdown Christmas and displays it with ANSI colors and emojis. A fun way to learn PowerShell.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-11T16:19:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-11T16:19:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-1024x606.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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun &#8211; A PowerShell Christmas Prompt\",\"datePublished\":\"2020-12-11T16:19:51+00:00\",\"dateModified\":\"2020-12-11T16:19:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/\"},\"wordCount\":436,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/christmas-countdown-1024x606.png\",\"keywords\":[\"ANSI\",\"emoji\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/\",\"name\":\"Friday Fun - A PowerShell Christmas Prompt &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/christmas-countdown-1024x606.png\",\"datePublished\":\"2020-12-11T16:19:51+00:00\",\"dateModified\":\"2020-12-11T16:19:57+00:00\",\"description\":\"Here's how I built an PowerShell prompt that countsdown Christmas and displays it with ANSI colors and emojis. A fun way to learn PowerShell.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/christmas-countdown.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/christmas-countdown.png\",\"width\":2067,\"height\":1224},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7956\\\/friday-fun-a-powershell-christmas-prompt\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun &#8211; A PowerShell Christmas Prompt\"}]},{\"@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 PowerShell Christmas Prompt &#8226; The Lonely Administrator","description":"Here's how I built an PowerShell prompt that countsdown Christmas and displays it with ANSI colors and emojis. A fun way to learn PowerShell.","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\/7956\/friday-fun-a-powershell-christmas-prompt\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun - A PowerShell Christmas Prompt &#8226; The Lonely Administrator","og_description":"Here's how I built an PowerShell prompt that countsdown Christmas and displays it with ANSI colors and emojis. A fun way to learn PowerShell.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/","og_site_name":"The Lonely Administrator","article_published_time":"2020-12-11T16:19:51+00:00","article_modified_time":"2020-12-11T16:19:57+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-1024x606.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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun &#8211; A PowerShell Christmas Prompt","datePublished":"2020-12-11T16:19:51+00:00","dateModified":"2020-12-11T16:19:57+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/"},"wordCount":436,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-1024x606.png","keywords":["ANSI","emoji"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/","name":"Friday Fun - A PowerShell Christmas Prompt &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown-1024x606.png","datePublished":"2020-12-11T16:19:51+00:00","dateModified":"2020-12-11T16:19:57+00:00","description":"Here's how I built an PowerShell prompt that countsdown Christmas and displays it with ANSI colors and emojis. A fun way to learn PowerShell.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown.png","width":2067,"height":1224},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Friday Fun &#8211; A PowerShell Christmas Prompt"}]},{"@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":4145,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4145\/friday-fun-christmas-countdown-prompt\/","url_meta":{"origin":7956,"position":0},"title":"Friday Fun Christmas Countdown Prompt","author":"Jeffery Hicks","date":"December 5, 2014","format":false,"excerpt":"It's that time of year again where PowerShell can make all your wishes come true. Ok, maybe that's a bit much, but PowerShell is the gift that keeps giving all year long. Again, maybe too much. How about this? Here's a revised version of my Christmas countdown prompt. I've posted\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"christmaslights","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/12\/christmaslights-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":5958,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5958\/friday-fun-perk-up-your-powershell-prompt\/","url_meta":{"origin":7956,"position":1},"title":"Friday Fun: Perk Up Your PowerShell Prompt","author":"Jeffery Hicks","date":"April 6, 2018","format":false,"excerpt":"I haven't written a Friday Fun post in quite a while. Often these posts don't have much practical value but hopefully illustrate a concept or technique. Although what I have today is something you could use immediately. I have a version of a PowerShell prompt function that will color code\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\/04\/pslocationprompt-2_thumb.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/04\/pslocationprompt-2_thumb.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/04\/pslocationprompt-2_thumb.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1307,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/","url_meta":{"origin":7956,"position":2},"title":"Friday Fun PowerShell Pep Talk","author":"Jeffery Hicks","date":"April 1, 2011","format":false,"excerpt":"Today's Friday Fun is meant to help get you excited about the upcoming Scripting Games. I want to add a little pep to your PowerShell prompt. Perhaps it will even keep you motivated. What I have for you today are variety of prompt functions. Consider them variations on a theme.\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"PowerShell Pep Talk","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt-300x144.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6240,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6240\/friday-fun-with-timely-powershell-prompts\/","url_meta":{"origin":7956,"position":3},"title":"Friday Fun with Timely PowerShell Prompts","author":"Jeffery Hicks","date":"November 30, 2018","format":false,"excerpt":"If PowerShell is a part of your daily routine, you most likely have a console window open all day. In addition to using PowerShell to get stuff done, you can use PowerShell to keep you on track. I've written before and talked about how I use PowerShell to manage my\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-13.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-13.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-13.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-13.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1849,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1849\/friday-fun-a-christmas-prompt\/","url_meta":{"origin":7956,"position":4},"title":"Friday Fun &#8211; A Christmas Prompt","author":"Jeffery Hicks","date":"November 25, 2011","format":false,"excerpt":"Over the last few weeks I've read about other people's PowerShell prompts and offered a few suggestions of my own. This week's Friday Fun creates colorful holiday prompt that counts down the number of days until Christmas. The function, uses a simple timespan object as part of the prompt. 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":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/11\/christmasprompt-300x106.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6439,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6439\/friday-fun-with-a-cross-platform-powershell-prompt\/","url_meta":{"origin":7956,"position":5},"title":"Friday Fun with a Cross-Platform PowerShell Prompt","author":"Jeffery Hicks","date":"January 18, 2019","format":false,"excerpt":"This year is turning out to be all things cross-platform for me. Continuing this line of discussion I have something fun and simple today. A PowerShell prompt function that will work cross-platform and provide some meaningful information in what I think is a elegant manner. You may not need the\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\/2019\/01\/image_thumb-20.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-20.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-20.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-20.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7956","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=7956"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7956\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=7956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=7956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=7956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}