{"id":4414,"date":"2015-05-26T17:45:10","date_gmt":"2015-05-26T21:45:10","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=4414"},"modified":"2015-05-26T17:45:10","modified_gmt":"2015-05-26T21:45:10","slug":"converting-timespans-to-repetition-patterns","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/","title":{"rendered":"Converting Timespans to Repetition Patterns"},"content":{"rendered":"<p>Over on Petri.com, I've recently published a followup <a href=\"https:\/\/www.petri.com\/creating-repeating-powershell-scheduled-jobs\" target=\"_blank\">article <\/a>about creating daily or weekly scheduled PowerShell jobs that support a repetition interval. The short answer is to use the Scheduled Tasks cmdlets. In the Petri article I talk about needing to use a special string format for the timespan. It is documented on <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa382117%28v=vs.85%29.aspx#properties\" target=\"_blank\">MSDN<\/a>.<\/p>\n<p>It isn't especially difficult to work it out, but I thought it would be handy to have a PowerShell function to convert a timespan to this format.<\/p>\n<pre class=\"lang:ps decode:true \" >Function ConvertTo-RepetitionPattern {\r\n&lt;#\r\n.Synopsis\r\nConvert a timespan to an XML repetition pattern\r\n.Description\r\nWhen creating scheduled tasks, repetition duration and intervals must be set using a special XML format.\r\n\r\nP&lt;days&gt;DT&lt;hours&gt;H&lt;minutes&gt;M&lt;seconds&gt;S\r\n\r\nThe minimum time allowed is 1 minute and the maximum is 31 days.\r\n.Example\r\nPS C:\\&gt; new-timespan -Minutes 10 | ConvertTo-RepetitionPattern\r\nPT10M\r\n.Example\r\nPS C:\\&gt; ConvertTo-RepetitionPattern \"0:1:10:0\"\r\nPT1H10M\r\n.Link\r\nhttps:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa382117%28v=vs.85%29.aspx#properties\r\n.Link\r\nNew-Timespan\r\n#&gt;\r\n[cmdletbinding()]\r\nParam(\r\n[Parameter(Position=0,Mandatory,HelpMessage = \"Enter a timespan\",\r\nValueFromPipeline)]\r\n[ValidateScript({$_.totalminutes -ge 1 -AND $_.totaldays -le 31})]\r\n[timespan]$Timespan\r\n)\r\n\r\nBegin {\r\n    Write-Verbose \"Starting $($MyInvocation.Mycommand)\"\r\n    [string]$pattern = \"P\"  \r\n} #begin\r\n\r\nProcess {\r\n    Write-Verbose \"Converting $Timespan\"\r\n    if ($Timespan.Days -gt 0) {\r\n        Write-Verbose \"$($timespan.days) Days\"\r\n        $Pattern+= \"{0}D\" -f $Timespan.Days\r\n    }\r\n    #insert T separater\r\n    $Pattern+=\"T\"\r\n\r\n    if ($Timespan.Hours -gt 0) {\r\n    Write-Verbose \"$($timespan.hours) Hours\"\r\n        $Pattern+= \"{0}H\" -f $Timespan.hours\r\n    }\r\n    if ($Timespan.Minutes -gt 0) {\r\n    Write-Verbose \"$($timespan.Minutes) Minutes\"\r\n        $Pattern+= \"{0}M\" -f $Timespan.Minutes\r\n    }\r\n    if ($Timespan.Seconds -gt 0) {\r\n        Write-Verbose \"$($timespan.seconds) Seconds\"\r\n        $Pattern+= \"{0}S\" -f $Timespan.Seconds\r\n    }\r\n\r\n    #write the result to the pipeline\r\n    $pattern\r\n}\r\nEnd {\r\n    Write-Verbose \"Ending $($MyInvocation.Mycommand)\"\r\n} #end\r\n\r\n} #end function<\/pre>\n<p>Technically, the pattern will support any timespan but since the pattern used with scheduled tasks must be between 1 minute and 31 days, I added that as a validation parameter. The function simply builds the final string based on the number of date time elements, i.e. hours, minutes and seconds. <\/p>\n<p>Hopefully this function makes it easier to automate the scheduled job and task process. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over on Petri.com, I&#8217;ve recently published a followup article about creating daily or weekly scheduled PowerShell jobs that support a repetition interval. The short answer is to use the Scheduled Tasks cmdlets. In the Petri article I talk about needing to use a special string format for the timespan. It is documented on MSDN. 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":"New from the blog: Converting Timespans to Repetition Patterns with #PowerShell","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[478,4],"tags":[534,126],"class_list":["post-4414","post","type-post","status-publish","format-standard","hentry","category-petri-it-knowledgebase","category-powershell","tag-powershell","tag-timespan"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Converting Timespans to Repetition Patterns &#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\/4414\/converting-timespans-to-repetition-patterns\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Converting Timespans to Repetition Patterns &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Over on Petri.com, I&#039;ve recently published a followup article about creating daily or weekly scheduled PowerShell jobs that support a repetition interval. The short answer is to use the Scheduled Tasks cmdlets. In the Petri article I talk about needing to use a special string format for the timespan. It is documented on MSDN. It...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2015-05-26T21:45:10+00:00\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Converting Timespans to Repetition Patterns\",\"datePublished\":\"2015-05-26T21:45:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/\"},\"wordCount\":152,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"PowerShell\",\"TimeSpan\"],\"articleSection\":[\"Petri IT Knowledgebase\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/\",\"name\":\"Converting Timespans to Repetition Patterns &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2015-05-26T21:45:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4414\\\/converting-timespans-to-repetition-patterns\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Petri IT Knowledgebase\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/petri-it-knowledgebase\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Converting Timespans to Repetition Patterns\"}]},{\"@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":"Converting Timespans to Repetition Patterns &#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\/4414\/converting-timespans-to-repetition-patterns\/","og_locale":"en_US","og_type":"article","og_title":"Converting Timespans to Repetition Patterns &#8226; The Lonely Administrator","og_description":"Over on Petri.com, I've recently published a followup article about creating daily or weekly scheduled PowerShell jobs that support a repetition interval. The short answer is to use the Scheduled Tasks cmdlets. In the Petri article I talk about needing to use a special string format for the timespan. It is documented on MSDN. It...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/","og_site_name":"The Lonely Administrator","article_published_time":"2015-05-26T21:45:10+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Converting Timespans to Repetition Patterns","datePublished":"2015-05-26T21:45:10+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/"},"wordCount":152,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["PowerShell","TimeSpan"],"articleSection":["Petri IT Knowledgebase","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/","name":"Converting Timespans to Repetition Patterns &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2015-05-26T21:45:10+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4414\/converting-timespans-to-repetition-patterns\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Petri IT Knowledgebase","item":"https:\/\/jdhitsolutions.com\/blog\/category\/petri-it-knowledgebase\/"},{"@type":"ListItem","position":2,"name":"Converting Timespans to Repetition Patterns"}]},{"@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":7101,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7101\/converting-lexical-timespans-with-powershell\/","url_meta":{"origin":4414,"position":0},"title":"Converting Lexical Timespans with PowerShell","author":"Jeffery Hicks","date":"December 18, 2019","format":false,"excerpt":"I've been working on a few scripting projects and the data I'm working with contains lexical timespans. Say what? You have probably seen these things. This is a string like P0DT0H0M47S to represents a timespan. They aren't difficult for humans to read. This one says \"0 days 0 hours 0\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\/12\/image_thumb-26.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-26.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-26.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-26.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7565,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7565\/formatting-powershell-timespans\/","url_meta":{"origin":4414,"position":1},"title":"Formatting PowerShell TimeSpans","author":"Jeffery Hicks","date":"June 24, 2020","format":false,"excerpt":"I often will figure out how to do something and later struggle to remember how to do it a months later. Rather than trying to remember what piece of code I wrote,\u00a0 why not write about. Assuming I can remember! Anyway, here's today's \"PSRemembery\". I often\u00a0 use code like this,\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\/06\/timespan-6.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/timespan-6.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/timespan-6.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/timespan-6.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/timespan-6.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":8357,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8357\/friday-fun-counting-down-events-with-powershell\/","url_meta":{"origin":4414,"position":2},"title":"Friday Fun: Counting Down Events with PowerShell","author":"Jeffery Hicks","date":"April 30, 2021","format":false,"excerpt":"We just finished a very successful virtual edition of the PowerShell+DevOps Global Summit. We lost our 2020 event to the pandemic but fortunately, the people at The DevOps Collective were able to pull together a fantastic virtual event. There were as many virtual attendees as we normally have at 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\/2021\/04\/get-pscountdown-format2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/get-pscountdown-format2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/get-pscountdown-format2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/04\/get-pscountdown-format2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7447,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7447\/get-installed-powershell-versions\/","url_meta":{"origin":4414,"position":3},"title":"Get Installed PowerShell Versions","author":"Jeffery Hicks","date":"May 7, 2020","format":false,"excerpt":"As is the norm for a typical day, I was working on one thing when I was distracted by a shiny rabbit hole (to mix some metaphors). Half a day later I have a new PowerShell function that not only might you find useful, but I think it has some\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\/05\/get-psinstalled-result2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/get-psinstalled-result2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/get-psinstalled-result2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/get-psinstalled-result2.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/get-psinstalled-result2.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/get-psinstalled-result2.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":7774,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7774\/easy-powershell-custom-formatting\/","url_meta":{"origin":4414,"position":4},"title":"Easy PowerShell Custom Formatting","author":"Jeffery Hicks","date":"October 15, 2020","format":false,"excerpt":"One of the features I truly enjoy about PowerShell, is the ability to have it present information that I need in a form that I want. Here's a good example. Running Get-Process is simple enough and the output is pretty complete. But one thing that would make it better for\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\/10\/get-process-ansi.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":4609,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4609\/historically-speaking\/","url_meta":{"origin":4414,"position":5},"title":"Historically Speaking","author":"Jeffery Hicks","date":"November 24, 2015","format":false,"excerpt":"So I've recently had a need to begin using Slack. I started out using a web browser, but since there is a Windows client I decided to give it a go. This article isn't about Slack as much as what I was curious about and how I decided to tackle\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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4414","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=4414"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4414\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}