{"id":9229,"date":"2023-03-14T10:32:28","date_gmt":"2023-03-14T14:32:28","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=9229"},"modified":"2023-03-14T10:32:31","modified_gmt":"2023-03-14T14:32:31","slug":"exposing-the-mystery-of-powershell-objects","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/","title":{"rendered":"Exposing the Mystery of PowerShell Objects"},"content":{"rendered":"\n<p>A few weeks ago, I was working on content for a new PowerShell course for Pluralsight. The subject was objects. We all know the importance of working with objects in PowerShell. Hopefully, you also know that the output you get on your screen from running a PowerShell command is not the whole story. Formatted presentation is separate from the underlying objects in the pipeline. That's why it is important to know how to use Get-Member to discover how an object is defined.<\/p>\n\n\n\n<p>In my course, I was in a section covering static methods. These are object methods that don't require an instance of the object. In most situations, when you want to invoke an object's method, you need an instance of the object.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$d = Get-Date\n$d.AddDays(45)<\/code><\/pre>\n\n\n\n<p>Get-Date creates a [DateTime] object, which has an AddDays() method. But the [DateTime] class has methods you can invoke that don't require an instance. These are static methods.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">PS C:\\&gt; [DateTime]::IsLeapYear(2024)\nTrue<\/code><\/pre>\n\n\n\n<p>Discovering static methods isn't easy. You can use Get-Member, but only if you already have an instance of the object.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png\"><img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"363\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png\" alt=\"Get-Member -static\" class=\"wp-image-9230\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png 596w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03-300x183.png 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>But what do you do with a class like [Math]? There's no way to pipe that to Get-Member. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get-TypeMember<\/h2>\n\n\n\n<p>I realized I wanted an alternative to Get-Member, so I wrote Get-TypeMember.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-07-33.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"372\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-07-33-1024x372.png\" alt=\"Get-TypeMember help\" class=\"wp-image-9231\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-07-33-1024x372.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-07-33-300x109.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-07-33-768x279.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-07-33-850x309.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-07-33.png 1080w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Specify a type name to discover an object's native members. The command will not show you members added by PowerShell.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-09-26.png\"><img loading=\"lazy\" decoding=\"async\" width=\"545\" height=\"516\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-09-26.png\" alt=\"Get-TypeMember datetime methods\" class=\"wp-image-9232\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-09-26.png 545w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-09-26-300x284.png 300w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Static entries will be displayed in green.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-12-25.png\"><img loading=\"lazy\" decoding=\"async\" width=\"497\" height=\"188\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-12-25.png\" alt=\"get-typemember datetime -name is\" class=\"wp-image-9233\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-12-25.png 497w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-12-25-300x113.png 300w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>The function writes its own type of object to the pipeline, although it is not exposed as a publically available class.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">PS C:\\&gt; Get-Typemember datetime -Name is* | Select *\n\nType         : System.DateTime\nName         : IsDaylightSavingTime\nMemberType   : Method\nPropertyType :\nReturnType   : System.Boolean\nFieldType    :\nIsStatic     : False\nSyntax       : $obj.IsDaylightSavingTime()\nTypeName     : System.DateTime\n\nType         : System.DateTime\nName         : IsLeapYear\nMemberType   : Method\nPropertyType :\nReturnType   : System.Boolean\nFieldType    :\nIsStatic     : True\nSyntax       : $obj.IsLeapYear([Int32]year)\nTypeName     : System.DateTime<\/code><\/pre>\n\n\n\n<p>I included a custom format file with an alternate table view.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-16-23.png\"><img loading=\"lazy\" decoding=\"async\" width=\"695\" height=\"186\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-16-23.png\" alt=\"Get-TypeMember syntax view\" class=\"wp-image-9234\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-16-23.png 695w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-16-23-300x80.png 300w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>I constructed the Syntax property value as a code snippet you could cut and paste.<\/p>\n\n\n\n<p>Here's where this command is useful.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-19-52.png\"><img loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"293\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-19-52.png\" alt=\"Math type members\" class=\"wp-image-9235\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-19-52.png 547w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-19-52-300x161.png 300w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/a><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">PS C:\\&gt; (Get-Typemember math -Name round).Syntax | Select-Object -unique\n$obj.Round([Decimal]d)\n$obj.Round([Decimal]d,[Int32]decimals)\n$obj.Round([Decimal]d,[MidpointRounding]mode)\n$obj.Round([Decimal]d,[Int32]decimals,[MidpointRounding]mode)\n$obj.Round([Double]a)\n$obj.Round([Double]value,[Int32]digits)\n$obj.Round([Double]value,[MidpointRounding]mode)\n$obj.Round([Double]value,[Int32]digits,[MidpointRounding]mode)<\/code><\/pre>\n\n\n\n<p>My function is intended to supplement Get-Member, not replace it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get It<\/h2>\n\n\n\n<p>Want to try it out? <a href=\"https:\/\/github.com\/jdhitsolutions\/PSScriptTools\/blob\/master\/docs\/Get-TypeMember.md\" target=\"_blank\" rel=\"noreferrer noopener\">Get-TypeMember<\/a> It is part of the <a href=\"https:\/\/github.com\/jdhitsolutions\/PSScriptTools\" target=\"_blank\" rel=\"noreferrer noopener\">PSScriptTools<\/a> module, which you can install from the PowerShell Gallery. The function will work in Windows PowerShell and PowerShell 7, including cross-platform.<\/p>\n\n\n\n<p>I hope you'll let me know what you think.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few weeks ago, I was working on content for a new PowerShell course for Pluralsight. The subject was objects. We all know the importance of working with objects in PowerShell. Hopefully, you also know that the output you get on your screen from running a PowerShell command is not the whole story. Formatted presentation&#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 on the blog: Exposing the Mystery of #PowerShell Objects","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],"tags":[534,540],"class_list":["post-9229","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.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Exposing the Mystery of PowerShell Objects &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"Understanding objects in PowerShell is important and Get-Member is a valuable tool. But I wanted more so I wrote an alternative function.\" \/>\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\/9229\/exposing-the-mystery-of-powershell-objects\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exposing the Mystery of PowerShell Objects &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Understanding objects in PowerShell is important and Get-Member is a valuable tool. But I wanted more so I wrote an alternative function.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-14T14:32:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-14T14:32:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Exposing the Mystery of PowerShell Objects\",\"datePublished\":\"2023-03-14T14:32:28+00:00\",\"dateModified\":\"2023-03-14T14:32:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/\"},\"wordCount\":350,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/2023-03-14_10-03-03.png\",\"keywords\":[\"PowerShell\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/\",\"name\":\"Exposing the Mystery of PowerShell Objects &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/2023-03-14_10-03-03.png\",\"datePublished\":\"2023-03-14T14:32:28+00:00\",\"dateModified\":\"2023-03-14T14:32:31+00:00\",\"description\":\"Understanding objects in PowerShell is important and Get-Member is a valuable tool. But I wanted more so I wrote an alternative function.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/2023-03-14_10-03-03.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/2023-03-14_10-03-03.png\",\"width\":596,\"height\":363},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/9229\\\/exposing-the-mystery-of-powershell-objects\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exposing the Mystery of PowerShell Objects\"}]},{\"@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":"Exposing the Mystery of PowerShell Objects &#8226; The Lonely Administrator","description":"Understanding objects in PowerShell is important and Get-Member is a valuable tool. But I wanted more so I wrote an alternative function.","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\/9229\/exposing-the-mystery-of-powershell-objects\/","og_locale":"en_US","og_type":"article","og_title":"Exposing the Mystery of PowerShell Objects &#8226; The Lonely Administrator","og_description":"Understanding objects in PowerShell is important and Get-Member is a valuable tool. But I wanted more so I wrote an alternative function.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/","og_site_name":"The Lonely Administrator","article_published_time":"2023-03-14T14:32:28+00:00","article_modified_time":"2023-03-14T14:32:31+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Exposing the Mystery of PowerShell Objects","datePublished":"2023-03-14T14:32:28+00:00","dateModified":"2023-03-14T14:32:31+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/"},"wordCount":350,"commentCount":9,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png","keywords":["PowerShell","Scripting"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/","name":"Exposing the Mystery of PowerShell Objects &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png","datePublished":"2023-03-14T14:32:28+00:00","dateModified":"2023-03-14T14:32:31+00:00","description":"Understanding objects in PowerShell is important and Get-Member is a valuable tool. But I wanted more so I wrote an alternative function.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2023\/03\/2023-03-14_10-03-03.png","width":596,"height":363},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9229\/exposing-the-mystery-of-powershell-objects\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Exposing the Mystery of PowerShell Objects"}]},{"@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":6855,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-7\/6855\/powershell-scripting-for-linux-is-still-about-the-objects\/","url_meta":{"origin":9229,"position":0},"title":"PowerShell Scripting for Linux is Still About the Objects","author":"Jeffery Hicks","date":"October 8, 2019","format":false,"excerpt":"I've been trying to increase my Linux skills, especially as I begin to write PowerShell scripts and tools that can work cross-platform. One very important concept I want to make sure you don't overlook is that even when scripting for non-Windows platforms, you must still be thinking about objects. The\u2026","rel":"","context":"In &quot;PowerShell 7&quot;","block_context":{"text":"PowerShell 7","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-7\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":33,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/33\/use-internet-explorer-in-powershell\/","url_meta":{"origin":9229,"position":1},"title":"Use Internet Explorer in PowerShell","author":"Jeffery Hicks","date":"May 23, 2006","format":false,"excerpt":"Here's a PowerShell Script that demonstates how to create COM objects in PowerShell, in this case an Internet Explorer instance. The script then takes the output of the Get-Service cmdlet and writes the results to the IE window.# IEServiceList.ps1# Jeffery Hicks# http:\/\/jdhitsolutions.blogspot.com# http:\/\/www.jdhitsolutions.com# May 2006#Display all running services in an\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":531,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/531\/think-objectively\/","url_meta":{"origin":9229,"position":2},"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":5850,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5850\/extending-powershell-datetime-objects\/","url_meta":{"origin":9229,"position":3},"title":"Extending PowerShell DateTime Objects","author":"Jeffery Hicks","date":"December 28, 2017","format":false,"excerpt":"I've been experimenting more with my PSTypeExtensionTools module, finding more objects to enhance.\u00a0 You can check out the project on Github and install the module from the PowerShell Gallery. My current fun has been with the DateTime object \u2013 specifically converting a value into another culture.\u00a0 Apparently those of us\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\/2017\/12\/image_thumb-13.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/12\/image_thumb-13.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/12\/image_thumb-13.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":8400,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8400\/friday-fun-custom-grouping-with-powershell\/","url_meta":{"origin":9229,"position":4},"title":"Friday Fun &#8211; Custom Grouping with PowerShell","author":"Jeffery Hicks","date":"May 14, 2021","format":false,"excerpt":"The other day I was answering a question in the PowerShell Facebook group. This person was getting data from Active Directory and trying to organize the results in a way that met his business requirements. My suggestion was to use Group-Object and a custom grouping property. I am assuming you\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/custom-grouping.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/custom-grouping.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/custom-grouping.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/custom-grouping.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2009,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/","url_meta":{"origin":9229,"position":5},"title":"Using Types with Imported CSV Data in PowerShell","author":"Jeffery Hicks","date":"January 19, 2012","format":false,"excerpt":"The Import-CSV cmdlet in PowerShell is incredibly useful. You can take any CSV file and pump objects to the pipeline. The cmdlet uses the CSV header as properties for the custom object. PS S:\\> import-csv .\\testdata.csv Date : 1\/18\/2012 6:45:30 AM Name : Data_1 Service : ALG Key : 1\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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/9229","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=9229"}],"version-history":[{"count":2,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/9229\/revisions"}],"predecessor-version":[{"id":9237,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/9229\/revisions\/9237"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=9229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=9229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=9229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}