{"id":5242,"date":"2016-09-13T09:20:34","date_gmt":"2016-09-13T13:20:34","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=5242"},"modified":"2016-09-13T09:20:34","modified_gmt":"2016-09-13T13:20:34","slug":"another-powershell-todo-tool","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/","title":{"rendered":"Another PowerShell ToDo Tool"},"content":{"rendered":"<p>Recently a reader, <a title=\"check out Matt's blog for other great stuff\" href=\"https:\/\/mattypenny.net\/\" target=\"_blank\">Matt Penny<\/a>, shared a tip in a comment on one of my articles. He had a short and simple PowerShell function that he used to insert ToDo commands into his Pester test scripts. Although you could easily use it for other PowerShell work. Of course, I am always on the look out for inspiration so I took Matt's idea and overworked it.<\/p>\n<p><!--more--><\/p>\n<p>Matt's original function was very simple, which is always a good thing.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">function todo {\r\nparam ([string]$TodoText)\r\nwrite-host -foregroundcolor DarkYellow \u201d [o] Todo: $TodoText\u201d\r\n}\r\n<\/pre>\n<p>Then in a script or function all he has to do is add lines that invoke this function. There is an assumption that this ToDo function is already loaded, perhaps as part of a profile script. Here's a demo function with several ToDo commands inserted. These indicate additional sections that need to be coded.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">Function Demo {\r\n[cmdletbinding()]\r\nParam(\r\n\r\n[Parameter(ValueFromPipeline)]\r\n[int]$X = 1\r\n)\r\n\r\nBegin {\r\n    Write-Verbose \"[BEGIN  ] Starting: $($MyInvocation.Mycommand)\"  \r\n    ToDo \"verbose PSBoundparameter data goes here\"\r\n} #begin\r\n\r\nProcess {\r\n    Write-Verbose \"[PROCESS] Processing $X\"\r\n    ToDo \"calculate square root of X\" \r\n    ToDo \"calculate X^X\" \r\n   \r\n    #write a custom object to the pipeline\r\n    [pscustomobject]@{\r\n        Value = $X\r\n        Square = $X*$X\r\n        SquareRoot = 0\r\n        Power = 0\r\n    }\r\n\r\n    ToDo \"add option to save output\" \r\n} #process\r\n\r\nEnd {\r\n    ToDo \"Display runtime\"\r\n    ToDo \"Clean up environment\" \r\n\r\n    Write-Verbose \"[END    ] Ending: $($MyInvocation.Mycommand)\"\r\n} #end\r\n}\r\n<\/pre>\n<p>When I run the command, I see the ToDo statements.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-1.png\" alt=\"image\" width=\"644\" height=\"265\" border=\"0\" \/><\/a><\/p>\n<p>I like that. But I was curious to see what else I could do with it. Of course even if you have no need for my version of the function, I hope you'll learn something new.<\/p>\n<p>I decided I wanted to have each ToDo numbered. I thought it also might be nice to color code ToDo entries to help me prioritize which to work on first. Finally, the current implementation doesn't work very well when running something in a pipelined expression. My Demo function takes pipeline input so if I test it with say 3 numbers I'll get 3 copies of the ToDo items, when all I really need is one.<\/p>\n<p>Keeping a count is relatively simple. I can initialize a variable and then use the ++ operator to increment it. The challenge though is scope. When I call my version of the ToDo function, I get a new scope which disappears when the function exits. And I don't want to make my main script more difficult to write. So I will create a variable in the global scope and increment it. Note that best practice is to avoid referencing out of scope items, but there are always exceptions. This is one of them. By using the $global: prefix I'm telling PowerShell I know what I'm doing.<\/p>\n<p>The other challenge was keeping track of what messages have already been displayed so I cut down on duplicates during a pipelined operation. Again, I resorted to a global variable\u00a0 to keep track of message history. If the message has already been displayed don't do anything, otherwise show it and add it to the history variable.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">if (-Not ($global:ToDoHistory -contains $ToDo)) {\r\n        $global:ToDoCounter++\r\n        #format the counter with 2 leading zeros.\r\n        $msg = \"[$($global:ToDoCounter.ToString(\"00#\"))] TO-DO: $ToDo\"\r\n\r\n        Write-Host $msg -ForegroundColor $ForegroundColor\r\n        $global:TodoHistory+=$ToDo\r\n    }\r\n<\/pre>\n<p>To demonstrate here is a modified version of my demo function that invokes my version of the ToDo function. My version takes a parameter for the message and an optional parameter for the message color. The default is Cyan.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">Function Demo {\r\n[cmdletbinding()]\r\nParam(\r\n\r\n[Parameter(ValueFromPipeline)]\r\n[int]$X = 1\r\n)\r\n\r\nBegin {\r\n    Write-Verbose \"[BEGIN  ] Starting: $($MyInvocation.Mycommand)\"  \r\n    ToDo \"verbose PSBoundparameter data goes here\" yellow\r\n} #begin\r\n\r\nProcess {\r\n    Write-Verbose \"[PROCESS] Processing $X\"\r\n    ToDo \"calculate square root of X\" red\r\n    ToDo \"calculate X^X\" \r\n   \r\n    #write a custom object to the pipeline\r\n    [pscustomobject]@{\r\n        Value = $X\r\n        Square = $X*$X\r\n        SquareRoot = 0\r\n        Power = 0\r\n    }\r\n\r\n    ToDo \"add option to save output\" green\r\n} #process\r\n\r\nEnd {\r\n    ToDo \"Display runtime\"\r\n    ToDo \"Clean up environment\" red\r\n\r\n    &lt;#\r\n    force ToDo cleanup\r\n    This is optional. If you don't, you'll manually need to clear\r\n    $ToDoHistory and $ToDoCounter from the global scope before \r\n    running another script that uses ToDo.\r\n    #&gt;\r\n    Remove-ToDoVariable\r\n\r\n    Write-Verbose \"[END    ] Ending: $($MyInvocation.Mycommand)\"\r\n} #end\r\n}\r\n<\/pre>\n<p>As I complete ToDos I can delete the line from the function. The only thing extra I added was an additional function, Remove-ToDoVariable, in the End block to clean up the global variables. Otherwise, the next time I ran the function, the global variables would be re-used which wouldn't be helpful. You wouldn't have to take this step, you could always manually reset the variables before testing again. But now I get (perhaps) a more useful ToDo message.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-6.png\" alt=\"image\" width=\"644\" height=\"251\" border=\"0\" \/><\/a><\/p>\n<p>And a pipelined test doesn't repeat anything.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-7.png\" alt=\"image\" width=\"644\" height=\"336\" border=\"0\" \/><\/a><\/p>\n<p>I have put the entire set of functions on GitHub as a gist.<br \/>\n<script src=\"https:\/\/gist.github.com\/jdhitsolutions\/d49aa6c1bf3eba9d4bfaf3eaa216e29a.js\"><\/script><br \/>\nAs I mentioned, you may not have much of a need for the function itself, but hopefully you picked up a tip or two. Always interested in hearing what you think.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently a reader, Matt Penny, shared a tip in a comment on one of my articles. He had a short and simple PowerShell function that he used to insert ToDo commands into his Pester test scripts. Although you could easily use it for other PowerShell work. Of course, I am always on the look out&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Fresh from the blog: Another #PowerShell ToDo Tool","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":[4,8],"tags":[534,540],"class_list":["post-5242","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","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>Another PowerShell ToDo Tool &#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\/5242\/another-powershell-todo-tool\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Another PowerShell ToDo Tool &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Recently a reader, Matt Penny, shared a tip in a comment on one of my articles. He had a short and simple PowerShell function that he used to insert ToDo commands into his Pester test scripts. Although you could easily use it for other PowerShell work. Of course, I am always on the look out...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-13T13:20:34+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-1.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Another PowerShell ToDo Tool\",\"datePublished\":\"2016-09-13T13:20:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/\"},\"wordCount\":596,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/image_thumb-1.png\",\"keywords\":[\"PowerShell\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/\",\"name\":\"Another PowerShell ToDo Tool &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/image_thumb-1.png\",\"datePublished\":\"2016-09-13T13:20:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/image_thumb-1.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/image_thumb-1.png\",\"width\":644,\"height\":265},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5242\\\/another-powershell-todo-tool\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Another PowerShell ToDo Tool\"}]},{\"@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":"Another PowerShell ToDo Tool &#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\/5242\/another-powershell-todo-tool\/","og_locale":"en_US","og_type":"article","og_title":"Another PowerShell ToDo Tool &#8226; The Lonely Administrator","og_description":"Recently a reader, Matt Penny, shared a tip in a comment on one of my articles. He had a short and simple PowerShell function that he used to insert ToDo commands into his Pester test scripts. Although you could easily use it for other PowerShell work. Of course, I am always on the look out...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/","og_site_name":"The Lonely Administrator","article_published_time":"2016-09-13T13:20:34+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-1.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Another PowerShell ToDo Tool","datePublished":"2016-09-13T13:20:34+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/"},"wordCount":596,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-1.png","keywords":["PowerShell","Scripting"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/","name":"Another PowerShell ToDo Tool &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-1.png","datePublished":"2016-09-13T13:20:34+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-1.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/image_thumb-1.png","width":644,"height":265},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5242\/another-powershell-todo-tool\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Another PowerShell ToDo Tool"}]},{"@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":1404,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1404\/start-typeddemo\/","url_meta":{"origin":5242,"position":0},"title":"Start-TypedDemo","author":"Jeffery Hicks","date":"May 3, 2011","format":false,"excerpt":"As you know, I do a lot of presenting and training. Normally I use the ubiquitous Start-Demo function to run through a demo list of commands. Most of this time this works just fine. But when I'm doing videos, especially for a video project, I want the viewer to focus\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6175,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6175\/more-fun-with-powershell-thrillers\/","url_meta":{"origin":5242,"position":1},"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":[]},{"id":8793,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-7\/8793\/profile-powershell-functions\/","url_meta":{"origin":5242,"position":2},"title":"Profile PowerShell Functions","author":"Jeffery Hicks","date":"January 17, 2022","format":false,"excerpt":"I've published a stable release of the PSFunctionTools module to the PowerShell Gallery. Previously, it was pre-release. The module requires PowerShell 7.1 and later. Although, as I have mentioned in the past, you are welcome to fork the repository and create a version that will run on Windows PowerShell. I\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/get-functionprofile2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/get-functionprofile2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/get-functionprofile2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/get-functionprofile2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1423,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1423\/warning-signs\/","url_meta":{"origin":5242,"position":3},"title":"Warning Signs","author":"Jeffery Hicks","date":"May 11, 2011","format":false,"excerpt":"I was working on a project with an advanced PowerShell function. One of the goals was to take advantage of the common parameters like -ErrorVariable and -WarningVariable so that when you run the function you can save errors and warnings and work with them later. Turns out one of these\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/05\/warningvariable-300x184.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4305,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4305\/what-powershell-script-was-i-working-on\/","url_meta":{"origin":5242,"position":4},"title":"What PowerShell Script Was I Working On?","author":"Jeffery Hicks","date":"March 24, 2015","format":false,"excerpt":"Last week I shared a script for finding recently modified files in a given directory. In fact, it wouldn't be that difficult to find the last files I was working on and open them in the PowerShell ISE. Assuming my Get-RecentFile function is loaded it is a simple as this:\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3918,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/3918\/pimp-your-prompt\/","url_meta":{"origin":5242,"position":5},"title":"Pimp your Prompt","author":"Jeffery Hicks","date":"July 16, 2014","format":false,"excerpt":"If you are like me and live in PowerShell, then you spend a great deal of your day looking at your PowerShell prompt. That little indicator in the console and ISE that usually shows where you are. That little part of your PowerShell world is defined by a built-in function\u2026","rel":"","context":"In &quot;Powershell 3.0&quot;","block_context":{"text":"Powershell 3.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-3-0\/"},"img":{"alt_text":"bling2","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/07\/bling2-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5242","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=5242"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5242\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}