{"id":170,"date":"2009-08-05T11:01:00","date_gmt":"2009-08-05T15:01:00","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/2009\/08\/05\/friendly-wmi-dates\/"},"modified":"2009-08-05T11:01:53","modified_gmt":"2009-08-05T15:01:53","slug":"friendly-wmi-dates","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/","title":{"rendered":"Friendly WMI Dates"},"content":{"rendered":"<p>Gee..you think you know something only to find out you don\u2019t. Or maybe this falls into the category of teaching an old dog new tricks. <\/p>\n<p>When I first started using PowerShell several years ago, I learned about how to convert a WMI date to a more user friendly format. For example, this is not especially easy to read:<\/p>\n<p><font color=\"#0000ff\" size=\"2\" face=\"Consolas\">PS C:\\&gt; (gwmi win32_operatingsystem).lastbootuptime      <br \/>20090804133238.086379-240<\/font>     <\/p>\n<p>However, all WMI objects in PowerShell have a <strong>ConvertToDateTime()<\/strong> method. I simply got in the habit of using Select-Object to define a custom property with the re-formatted date. <\/p>\n<p><font color=\"#0000ff\" size=\"2\" face=\"Consolas\">PS C:\\&gt; gwmi win32_operatingsystem | Select Caption,@{name=&quot;LastBoot&quot;;      <br \/>&gt;&gt; Expression={$_.ConvertToDateTime($_.LastBootUpTime)}}       <br \/>&gt;&gt;<\/font><\/p>\n<p><font color=\"#0000ff\" size=\"2\" face=\"Consolas\">Caption&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; LastBoot      <br \/>-------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --------       <br \/>Microsoft Windows XP Professional&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 8\/4\/2009 1:32:38 PM<\/font><\/p>\n<p>There\u2019s nothing technically wrong with this approach. This method was added so that administrators who knew nothing about .NET, like myself at the time, would have a relative easy way of converting WMI datetime strings. But once you learn more PowerShell you discover where this method comes from.<\/p>\n<p>In the types.ps1xml file, you will find the <strong>ConvertToDateTime()<\/strong> method defined for all WMI objects.<\/p>\n<p><font color=\"#800080\">&lt;Name&gt;ConvertToDateTime&lt;\/Name&gt;      <br \/>&#160;&#160;&#160; [System.Management.ManagementDateTimeConverter]::ToDateTime($args[0])<\/font><\/p>\n<p>The method is simply calling the System.Management.ManagementDateTimeConverter objects <strong>ToDateTIme()<\/strong> method. Once you realize this my original expression can also be written:<\/p>\n<p><font color=\"#0000ff\" size=\"2\" face=\"Consolas\">PS C:\\&gt; gwmi win32_operatingsystem | Select Caption,@{name=&quot;LastBoot&quot;;      <br \/>&gt;&gt; Expression={[System.Management.ManagementDateTimeConverter]::ToDateTime(       <br \/>&gt;&gt; $_.LastBootUpTime)       <br \/>&gt;&gt; }}       <br \/>&gt;&gt; <\/font><\/p>\n<p><font color=\"#0000ff\" size=\"2\" face=\"Consolas\">Caption&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; LastBoot      <br \/>-------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --------       <br \/>Microsoft Windows XP Professional&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 8\/4\/2009 1:32:38 PM<\/font><\/p>\n<p>Whether that is easier to type or understand may be a matter of personal preference. However if I am presented with a WMI datetime string, perhaps from another object or maybe a log file, I can now easily convert it.<\/p>\n<p><font color=\"#0000ff\" size=\"2\" face=\"Consolas\">PS C:\\&gt; $x=&quot;20090708102530.360000-240&quot;      <br \/>PS C:\\&gt; [system.management.managementDateTimeConverter]::ToDateTime($x) <\/font><\/p>\n<p><font color=\"#0000ff\" size=\"2\" face=\"Consolas\">Wednesday, July 08, 2009 10:25:30 AM<\/font><\/p>\n<p>So if you have some old habits, now may be the time to check them and discover if perhaps there is a better or different way to accomplish something, especially with the impending arrival of PowerShell v2.0.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gee..you think you know something only to find out you don\u2019t. Or maybe this falls into the category of teaching an old dog new tricks. <\/p>\n<p>When I first started using PowerShell several years ago, I learned about how to convert a WMI date to a more user friendly format&#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,8,19],"tags":[70,534,540,71,547],"class_list":["post-170","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","category-wmi","tag-datetime","tag-powershell","tag-scripting","tag-system-management","tag-wmi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friendly WMI Dates &#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\/170\/friendly-wmi-dates\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friendly WMI Dates &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Gee..you think you know something only to find out you don\u2019t. Or maybe this falls into the category of teaching an old dog new tricks.  When I first started using PowerShell several years ago, I learned about how to convert a WMI date to a more user friendly format...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2009-08-05T15:01:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2009-08-05T15:01:53+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\\\/170\\\/friendly-wmi-dates\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/170\\\/friendly-wmi-dates\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friendly WMI Dates\",\"datePublished\":\"2009-08-05T15:01:00+00:00\",\"dateModified\":\"2009-08-05T15:01:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/170\\\/friendly-wmi-dates\\\/\"},\"wordCount\":358,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"DateTime\",\"PowerShell\",\"Scripting\",\"System.Management\",\"WMI\"],\"articleSection\":[\"PowerShell\",\"Scripting\",\"WMI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/170\\\/friendly-wmi-dates\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/170\\\/friendly-wmi-dates\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/170\\\/friendly-wmi-dates\\\/\",\"name\":\"Friendly WMI Dates &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2009-08-05T15:01:00+00:00\",\"dateModified\":\"2009-08-05T15:01:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/170\\\/friendly-wmi-dates\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/170\\\/friendly-wmi-dates\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/170\\\/friendly-wmi-dates\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friendly WMI Dates\"}]},{\"@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":"Friendly WMI Dates &#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\/170\/friendly-wmi-dates\/","og_locale":"en_US","og_type":"article","og_title":"Friendly WMI Dates &#8226; The Lonely Administrator","og_description":"Gee..you think you know something only to find out you don\u2019t. Or maybe this falls into the category of teaching an old dog new tricks.  When I first started using PowerShell several years ago, I learned about how to convert a WMI date to a more user friendly format...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/","og_site_name":"The Lonely Administrator","article_published_time":"2009-08-05T15:01:00+00:00","article_modified_time":"2009-08-05T15:01:53+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\/170\/friendly-wmi-dates\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friendly WMI Dates","datePublished":"2009-08-05T15:01:00+00:00","dateModified":"2009-08-05T15:01:53+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/"},"wordCount":358,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["DateTime","PowerShell","Scripting","System.Management","WMI"],"articleSection":["PowerShell","Scripting","WMI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/","name":"Friendly WMI Dates &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2009-08-05T15:01:00+00:00","dateModified":"2009-08-05T15:01:53+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/170\/friendly-wmi-dates\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Friendly WMI Dates"}]},{"@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":531,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/531\/think-objectively\/","url_meta":{"origin":170,"position":0},"title":"Think Objectively","author":"Jeffery Hicks","date":"December 14, 2009","format":false,"excerpt":"A challenge many new comers to PowerShell face, especially those arriving with a VBScript background, and one that I often talk about, is shifting gears from working with text to working with objects. Here\u2019s a good example. The Win32_OperatingSystem class returns a value for TotalVisibleMemorySize, which should be the amount\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":636,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/636\/select-wmi\/","url_meta":{"origin":170,"position":1},"title":"Select WMI","author":"Jeffery Hicks","date":"May 13, 2010","format":false,"excerpt":"I\u2019ve been helping out on some WMI and PowerShell issues in the forums at ScriptingAnswers.com. As I was working on a problem I ended up taking a slight detour to address an issue that has always bugged me. When I run a command like this: get-wmiobject -query \"Select Name,Description,Disabled from\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":"selectwmi","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/05\/selectwmi-300x89.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2241,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/","url_meta":{"origin":170,"position":2},"title":"Skipping WMI System Properties in PowerShell","author":"Jeffery Hicks","date":"April 25, 2012","format":false,"excerpt":"One of my favorite techniques when using WMI in PowerShell is to pipe an object to Select-Object and select all properties. Try this: get-wmiobject win32_bios | select * It works, but it also gets all of the system properties like __PATH which I rarely care about. I also get other\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":103,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/103\/more-with-process-and-service-uptime\/","url_meta":{"origin":170,"position":3},"title":"More with Process and Service uptime","author":"Jeffery Hicks","date":"February 20, 2007","format":false,"excerpt":"Like most things scripting, there's usually more than one way to do things. I thought I had a nice solution for getting service uptime via WMI. But alas, there is an even easier way. PowerShell has a ConvertToDateTime method which will convert a WMI time to a standard date time\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":639,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/639\/join-object\/","url_meta":{"origin":170,"position":4},"title":"Join Object","author":"Jeffery Hicks","date":"May 14, 2010","format":false,"excerpt":"Related to some of the WMI stuff I\u2019ve been working on lately is the idea of melding or joining objects. This comes about because I often see forum posts from administrators looking to collect information from different WMI classes but present it as a single object. One way you might\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":654,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/","url_meta":{"origin":170,"position":5},"title":"New WMI Object","author":"Jeffery Hicks","date":"May 17, 2010","format":false,"excerpt":"I have one more variation on my recent theme of working with WMI objects. I wanted to come up with something flexible and re-usable where you could specify a WMI class and some properties and get a custom object with all the classes combined. My solution is a function called\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\/170","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=170"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}