{"id":1307,"date":"2011-04-01T09:42:57","date_gmt":"2011-04-01T13:42:57","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1307"},"modified":"2011-04-01T09:42:57","modified_gmt":"2011-04-01T13:42:57","slug":"friday-fun-powershell-pep-talk","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/","title":{"rendered":"Friday Fun PowerShell Pep Talk"},"content":{"rendered":"<p>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.<!--more--><\/p>\n<p>Windows PowerShell has a default function called prompt that defines the console prompt. You can see your current prompt definition with a simple command.<\/p>\n<p>[cc lang=\"Powershell\"]<br \/>\nPS C:\\> $function:prompt<br \/>\n[\/cc]<\/p>\n<p>Today I'm going to give you some new prompt functions that will include a peppy PowerShell message. Normally you would put these commands in your profile script. But you can copy and paste into an open shell. First, let's define an array of our PowerShell slogans.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$global:slogans=@(<br \/>\n\"PowerShell Rocks!\",<br \/>\n\"Energize!!\",<br \/>\n\"To Shell and Back\",<br \/>\n\"I am the Shell\",<br \/>\n\"PowerShell to the People\",<br \/>\n\"Powered by PS\",<br \/>\n\"PowerShell Rulez!\",<br \/>\n\"PowerShell Fanboy\"<br \/>\n)<br \/>\n[\/cc]<\/p>\n<p>I'm using the global modifier to indicate this $slogans is a global variable. You'll get better results if you keep the messages close to the same length.  Now we need a function to get a random element from the array.  This is accomplished by piping the $slogans array to the Get-Random cmdlet. Here's a basic example.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Prompt {<\/p>\n<p>#reference the global $slogans array defined and<br \/>\n#get a random element.<br \/>\n\"$($global:slogans | Get-Random) $(Get-Location) > \"<\/p>\n<p>}<br \/>\n[\/cc]<\/p>\n<p>The function writes a string that is a combination of the randomly selected slogan and the current location. You would put this in your profile and start a new PowerShell session. Or you can copy and paste the function into your current session. This will give results like this:<\/p>\n<p>[cc lang=\"DOS\"]<br \/>\nPowered by PS E:\\temp > cd c:\\work<br \/>\nEnergize!! C:\\work > ps powershell<\/p>\n<p>Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName<br \/>\n-------  ------    -----      ----- -----   ------     -- -----------<br \/>\n    942      39   102028     112412   632    13.57   4852 powershell<\/p>\n<p>I am the Shell C:\\work ><br \/>\n[\/cc]<\/p>\n<p>Sort of ok. But it gets a little \"jagged\" because the messages are of different lengths. We can adjust this by padding the slogan text.  Here's a variation:<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Prompt {<br \/>\n#get length of longest slogan and pad accordingly<\/p>\n<p>#get the longest slogan length<br \/>\n$l=($slogans | sort length)[-1].length<br \/>\n#pad with the . character<br \/>\n\"$(($global:slogans | get-random).Padright($l+1,\".\"))$(Get-Location) > \"<\/p>\n<p>}<br \/>\n[\/cc]<\/p>\n<p>This function gets the length of the longest entry in array and uses that value in the PadRight() method. In my version I'm padding with the period. Here's the end result:<\/p>\n<p>[cc lang=\":DOS\"]<br \/>\nPowerShell Rulez!.C:\\work > cd hklm:<br \/>\nPowerShell Rocks!.HKLM:\\ > cd wsman:<br \/>\nPowerShell Rulez!.WSMan:\\ ><br \/>\nPowerShell Fanboy.WSMan:\\ > ps powershell<\/p>\n<p>Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName<br \/>\n-------  ------    -----      ----- -----   ------     -- -----------<br \/>\n   1129      39   102252     112772   632    13.65   4852 powershell<\/p>\n<p>I am the Shell....WSMan:\\ ><br \/>\nEnergize!!........WSMan:\\ ><br \/>\n[\/cc]<\/p>\n<p>A little nicer. What about adding some color?<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Prompt {<\/p>\n<p>#get the longest slogan length<br \/>\n$l=($slogans | sort length)[-1].length<br \/>\n#pad with the . character<br \/>\nWrite-Host \"$(($global:slogans | get-random).Padright($l+1,\".\"))\" -foregroundcolor CYAN -NoNewLine<br \/>\nWrite-host \"$(Get-Location)\" -NoNewline<br \/>\n#the function has to return something<br \/>\nWrite \"> \"<\/p>\n<p>}<br \/>\n[\/cc]<\/p>\n<p>The only difference is that I'm using Write-Host to display components of the prompt using the -foreground color parameter.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt-300x144.png\" alt=\"PowerShell Pep Talk\" title=\"color-pep-prompt\" width=\"300\" height=\"144\" class=\"aligncenter size-medium wp-image-1308\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt-300x144.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt.png 899w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Finally, how about adding a cheerleader?  We'll add this to the profile, or paste into your session to test.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n#create a global Voice object in your profile<br \/>\n$global:Voice=New-Object -ComObject SAPI.SPVoice<br \/>\n[\/cc]<\/p>\n<p>And here is my prompt function that will now \"speak\" the PowerShell slogan to really get me motivated.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Prompt {<\/p>\n<p>#get the longest slogan length<br \/>\n$l=($slogans | sort length)[-1].length<\/p>\n<p>#get a slogan<br \/>\n$text=$global:slogans | Get-Random<\/p>\n<p>#pad with spaces<br \/>\nWrite-Host \"$($text.Padright($l+1,\" \"))\" -foregroundcolor CYAN -NoNewLine<br \/>\nWrite-host \"$(Get-Location)\" -NoNewline<br \/>\n#the function has to return something<br \/>\nWrite \"> \"<\/p>\n<p>#speak it<br \/>\n$global:voice.speak($text) | Out-Null<\/p>\n<p>}<br \/>\n[\/cc]<\/p>\n<p>I hope you'll give this a shot.  And don't worry, assuming you haven't modified your profile, any changes made will go away when you close your session. Open a new session and you will be back at your original prompt. Enjoy!<\/p>\n<p>You can download my code samples <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/Slogan-Prompt.txt' target='_blank'>here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;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.<\/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":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[271,4,8],"tags":[145,230,224,534,239],"class_list":["post-1307","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","category-scripting","tag-array","tag-fridayfun","tag-function","tag-powershell","tag-prompt"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun PowerShell Pep Talk &#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\/1307\/friday-fun-powershell-pep-talk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun PowerShell Pep Talk &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Today&#039;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.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-04-01T13:42:57+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt-300x144.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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun PowerShell Pep Talk\",\"datePublished\":\"2011-04-01T13:42:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/\"},\"wordCount\":713,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/04\\\/color-pep-prompt-300x144.png\",\"keywords\":[\"Array\",\"FridayFun\",\"Function\",\"PowerShell\",\"prompt\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/\",\"name\":\"Friday Fun PowerShell Pep Talk &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/04\\\/color-pep-prompt-300x144.png\",\"datePublished\":\"2011-04-01T13:42:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/04\\\/color-pep-prompt.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/04\\\/color-pep-prompt.png\",\"width\":\"899\",\"height\":\"434\",\"caption\":\"PowerShell Pep Talk\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1307\\\/friday-fun-powershell-pep-talk\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun PowerShell Pep Talk\"}]},{\"@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 PowerShell Pep Talk &#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\/1307\/friday-fun-powershell-pep-talk\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun PowerShell Pep Talk &#8226; The Lonely Administrator","og_description":"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.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-04-01T13:42:57+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt-300x144.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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun PowerShell Pep Talk","datePublished":"2011-04-01T13:42:57+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/"},"wordCount":713,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt-300x144.png","keywords":["Array","FridayFun","Function","PowerShell","prompt"],"articleSection":["Friday Fun","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/","name":"Friday Fun PowerShell Pep Talk &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt-300x144.png","datePublished":"2011-04-01T13:42:57+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt.png","width":"899","height":"434","caption":"PowerShell Pep Talk"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun PowerShell Pep Talk"}]},{"@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":976,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/976\/friday-fun-more-prompts\/","url_meta":{"origin":1307,"position":0},"title":"Friday Fun &#8211; More Prompts","author":"Jeffery Hicks","date":"October 22, 2010","format":false,"excerpt":"Not too long ago I offered up a tasting of PowerShell prompts 3 ways. My first offering were variations on displaying the current date and time. But a PowerShell prompt can do much more. For today's Friday Fun I present a duo of of calculating prompts. The first item on\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\/2010\/10\/timetogo-prompt-300x142.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6262,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6262\/revised-everything-powershell-prompt\/","url_meta":{"origin":1307,"position":1},"title":"Revised Everything PowerShell Prompt","author":"Jeffery Hicks","date":"December 7, 2018","format":false,"excerpt":"Since it is Friday and time for some more PowerShell fun, and I\u2019ve been sharing some of my prompt functions, I thought I\u2019d re-share my kitchen sink prompt. This PowerShell prompt function does *a lot* to things and gives you a snapshot view of your system everytime you press enter.\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\/12\/image_thumb-5.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/12\/image_thumb-5.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/12\/image_thumb-5.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1292,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1292\/new-comment-help\/","url_meta":{"origin":1307,"position":2},"title":"New Comment Help","author":"Jeffery Hicks","date":"March 29, 2011","format":false,"excerpt":"If you follow my blog I'm sure you noticed that I post a lot of advanced functions and scripts. While I don't expect every one to be developing advanced functions, the closer you can get the more powerful your work. With the Scripting Games approaching I thought I'd offer up\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\/2011\/03\/helpbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1849,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1849\/friday-fun-a-christmas-prompt\/","url_meta":{"origin":1307,"position":3},"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":7149,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7149\/friday-fun-taking-a-shortcut-path-in-your-powershell-prompt\/","url_meta":{"origin":1307,"position":4},"title":"Friday Fun: Taking a Shortcut Path in Your PowerShell Prompt","author":"Jeffery Hicks","date":"January 3, 2020","format":false,"excerpt":"To kick off the new year I thought I'd take a shortcut and reclaim some wasted space in my PowerShell prompt. I know I run into this issue during classes and conferences. Perhaps you encounter it as well. You are in in the PowerShell console and have ended up in\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\/01\/image_thumb-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/image_thumb-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/image_thumb-3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/image_thumb-3.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6439,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6439\/friday-fun-with-a-cross-platform-powershell-prompt\/","url_meta":{"origin":1307,"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\/1307","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=1307"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1307\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}