{"id":1040,"date":"2011-01-10T08:26:22","date_gmt":"2011-01-10T13:26:22","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1040"},"modified":"2011-01-10T08:26:22","modified_gmt":"2011-01-10T13:26:22","slug":"convert-to-title-case","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/","title":{"rendered":"Convert to Title Case"},"content":{"rendered":"<p>After a long holiday break, some travel and a few training classes its time to get back in the swing of things. Today I have a relatively simple function, that if nothing else demonstrates how to use  object methods. The challenge is to take a string of text and convert it into title case; so that \"great expectations\" becomes \"Great Expectations\".<!--more--><\/p>\n<p>To accomplish this, all I need to do is get the first letter of each string and invoke the string object's ToUpper() method. But before I can do that I need to break the title string into an array of individual words which is easily accomplished using the Split() method.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> $t=\"gone with the wind\"<br \/>\nPS S:\\> foreach ($w in $t.split()) {$w}<br \/>\ngone<br \/>\nwith<br \/>\nthe<br \/>\nwind<br \/>\n[\/cc]<br \/>\nNow I have to convert the first letter of each word to upper case and then append the rest of the word. I'll use the SubString() method.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> foreach ($w in $t.split()) {$w.substring(0,1).ToUpper()+$w.Substring(1)}<br \/>\nGone<br \/>\nWith<br \/>\nThe<br \/>\nWind<br \/>\n[\/cc]<br \/>\nI don't really like using concatenation but it works here but I still have an array. I need to tell PowerShell to treat the entire array as a single string.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> [string]$title=foreach ($w in $t.split()) {$w.substring(0,1).ToUpper()+$w.Substring(1)}<br \/>\nPS S:\\> $title<br \/>\nGone With The Wind<br \/>\n[\/cc]<br \/>\nThe actual conversion only takes a single line of PowerShell, but I went ahead and created an advanced function called ConvertTo-TitleCase to make it easier to use.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nFunction ConvertTo-TitleCase {<\/p>\n<p><#\n   .Synopsis\n    Convert a string to title case. \n    .Description\n    Take a string and return a version in title case where each word is capitalized.\n     .Parameter Text\n    The string you wish to convert to title case.\n   .Example\n    PS C:\\> ConvertTo-TitleCase \"a tale of two cities\"<br \/>\n    A Tale Of Two Cities<\/p>\n<p>   .Notes<br \/>\n    NAME: ConvertTo-TitleCase-<br \/>\n    VERSION: 1.0<br \/>\n    AUTHOR: Jeffery Hicks<br \/>\n    LASTEDIT: 1\/10\/2011<\/p>\n<p>    Learn more with a copy of Windows PowerShell 2.0: TFM (SAPIEN Press 2010)<\/p>\n<p>   .Link<br \/>\n    Http:\/\/jdhitsolutions.com\/blog<\/p>\n<p>   .Link<br \/>\n    Out-String<\/p>\n<p>   .Inputs<br \/>\n    [string]<br \/>\n   .Outputs<br \/>\n    [string]<\/p>\n<p>#><\/p>\n<p>[cmdletBinding()]<\/p>\n<p>Param(<br \/>\n[Parameter(Position=0,Mandatory=$True,ValueFromPipeline=$True)]<br \/>\n[ValidateNotNullOrEmpty()]<br \/>\n[string[]]$Text<\/p>\n<p>)<\/p>\n<p> Begin<br \/>\n {<br \/>\n    Write-Verbose -Message \"Starting $($myinvocation.mycommand)\"<\/p>\n<p> } #close Begin<\/p>\n<p> Process {<br \/>\n    ForEach ($string in $Text)<br \/>\n    {<br \/>\n     \tWrite-Verbose -Message \"Processing $string\"<\/p>\n<p>\t#split the string into indvidual words<br \/>\n     \t$tmp=$string.Split()<\/p>\n<p>\t#define an array to hold modified results<br \/>\n     \t$out=@()<br \/>\n     \tforeach ($word in $tmp)<br \/>\n     \t{<br \/>\n\t   #take the first letter of each word and make it upper case,<br \/>\n\t   #then append the rest of the word<br \/>\n           $out+=\"{0}{1}\" -f $word.SubString(0,1).ToUpper(),$word.substring(1)<br \/>\n     \t}<\/p>\n<p>\t#write the results<br \/>\n    \tWrite-Output ($out -as [string])<br \/>\n    }<br \/>\n } #close process<\/p>\n<p> End<br \/>\n {<br \/>\n    Write-Verbose -Message \"Ending $($myinvocation.mycommand)\"<br \/>\n } #close End<\/p>\n<p>} #end Function<br \/>\n [\/cc]<br \/>\nThe function can be run like this:<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> ConvertTo-TitleCase \"the wizard of oz\"<br \/>\nThe Wizard Of Oz<br \/>\n[\/cc]<br \/>\nOr it can accept pipelined input.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> \"the shining\",\"the stand\",\"under the dome\",\"the dark tower\" | ConvertTo-TitleCase<br \/>\nThe Shining<br \/>\nThe Stand<br \/>\nUnder The Dome<br \/>\nThe Dark Tower<br \/>\n[\/cc]<br \/>\nDownload the script file <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/01\/ConvertTo-TitleCase.txt'>ConvertTo-TitleCase<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After a long holiday break, some travel and a few training classes its time to get back in the swing of things. Today I have a relatively simple function, that if nothing else demonstrates how to use object methods. The challenge is to take a string of text and convert it into title case; so&#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":"","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":[4],"tags":[32,534,540,243],"class_list":["post-1040","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-functions","tag-powershell","tag-scripting","tag-string"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Convert to Title Case &#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\/1040\/convert-to-title-case\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Convert to Title Case &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"After a long holiday break, some travel and a few training classes its time to get back in the swing of things. Today I have a relatively simple function, that if nothing else demonstrates how to use object methods. The challenge is to take a string of text and convert it into title case; so...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-01-10T13:26:22+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\\\/1040\\\/convert-to-title-case\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1040\\\/convert-to-title-case\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Convert to Title Case\",\"datePublished\":\"2011-01-10T13:26:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1040\\\/convert-to-title-case\\\/\"},\"wordCount\":471,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"functions\",\"PowerShell\",\"Scripting\",\"string\"],\"articleSection\":[\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1040\\\/convert-to-title-case\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1040\\\/convert-to-title-case\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1040\\\/convert-to-title-case\\\/\",\"name\":\"Convert to Title Case &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-01-10T13:26:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1040\\\/convert-to-title-case\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1040\\\/convert-to-title-case\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1040\\\/convert-to-title-case\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Convert to Title Case\"}]},{\"@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":"Convert to Title Case &#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\/1040\/convert-to-title-case\/","og_locale":"en_US","og_type":"article","og_title":"Convert to Title Case &#8226; The Lonely Administrator","og_description":"After a long holiday break, some travel and a few training classes its time to get back in the swing of things. Today I have a relatively simple function, that if nothing else demonstrates how to use object methods. The challenge is to take a string of text and convert it into title case; so...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-01-10T13:26:22+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\/1040\/convert-to-title-case\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Convert to Title Case","datePublished":"2011-01-10T13:26:22+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/"},"wordCount":471,"commentCount":4,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["functions","PowerShell","Scripting","string"],"articleSection":["PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/","name":"Convert to Title Case &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-01-10T13:26:22+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1040\/convert-to-title-case\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Convert to Title Case"}]},{"@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":1319,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/1319\/powershell-ise-case-closed\/","url_meta":{"origin":1040,"position":0},"title":"PowerShell ISE Case Closed","author":"Jeffery Hicks","date":"April 5, 2011","format":false,"excerpt":"When writing a PowerShell script or function, things like indentations, white space and case make a big difference in how easy it is to read and understand your code. Sometimes it can be helpful to have a word or sentence in all upper case so that it stands out. Here\u2026","rel":"","context":"In &quot;PowerShell ISE&quot;","block_context":{"text":"PowerShell ISE","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1046,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1046\/convert-history-to-script\/","url_meta":{"origin":1040,"position":1},"title":"Convert History to Script","author":"Jeffery Hicks","date":"January 12, 2011","format":false,"excerpt":"Whenever I teach or speak about PowerShell, a recurring mantra is that there is no difference between running a PowerShell script and executing commands interactively in the shell, except that it saves you typing. You can create a PowerShell script by simply copying and pasting commands from the shell into\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":1242,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1242\/convert-transcript-to-script\/","url_meta":{"origin":1040,"position":2},"title":"Convert Transcript to Script","author":"Jeffery Hicks","date":"March 21, 2011","format":false,"excerpt":"During my PowerShell scripting best practices at Techmentor last week I mentioned a function I had to convert a PowerShell transcript to a script file. Since there's very little difference between an interactive session and a script, parsing the transcript can yield 80% or more of a script very quickly.\u2026","rel":"","context":"In &quot;Conferences&quot;","block_context":{"text":"Conferences","link":"https:\/\/jdhitsolutions.com\/blog\/category\/conferences\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9018,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9018\/an-iron-scripter-warm-up-solution\/","url_meta":{"origin":1040,"position":3},"title":"An Iron Scripter Warm-Up Solution","author":"Jeffery Hicks","date":"May 6, 2022","format":false,"excerpt":"We just wrapped up the 2022 edition of the PowerShell+DevOps Global Summit. It was terrific to be with passionate PowerShell professionals again. The culmination of the event is the Iron Scripter Challenge. You can learn more about this year's event and winner here. But there is more to the Iron\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":1389,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1389\/friday-fun-randomness-abounds\/","url_meta":{"origin":1040,"position":4},"title":"Friday Fun Randomness Abounds","author":"Jeffery Hicks","date":"April 29, 2011","format":false,"excerpt":"I find it a little ironic that although I like efficiency, structure and order I'm fascinated with randomness. In today's Friday Fun I want to explore a few ways you might incorporate randomness into your PowerShell scripting. Perhaps you need a random number between 100 and 500. Or a string\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":"","width":0,"height":0},"classes":[]},{"id":1055,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1055\/more-wmi-dates-win32product-installdate\/","url_meta":{"origin":1040,"position":5},"title":"More WMI Dates \u2013 Win32Product InstallDate","author":"Jeffery Hicks","date":"January 11, 2011","format":false,"excerpt":"I've written in the past about converting obtuse WMI datetime formats into more user friendly formats. The other day via Twitter I got a question about the InstallDate property that comes from the Win32_Product class. This property has a different format, than what I've written about previously. And while I\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\/1040","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=1040"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1040\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}