{"id":2241,"date":"2012-04-25T09:15:06","date_gmt":"2012-04-25T13:15:06","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=2241"},"modified":"2012-04-25T09:15:06","modified_gmt":"2012-04-25T13:15:06","slug":"skipping-wmi-system-properties-in-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/","title":{"rendered":"Skipping WMI System Properties in PowerShell"},"content":{"rendered":"<p>One of my favorite techniques when using WMI in PowerShell is to pipe an object to Select-Object and select all properties. Try this:<\/p>\n<p><code lang=\"Powershell\"><br \/>\nget-wmiobject win32_bios | select *<br \/>\n<\/code><\/p>\n<p>It works, but it also gets all of the system properties like __PATH which I rarely care about. I also get other properties like Site and Options which I typically don't need. So here are some techniques you can use to view all WMI properties that probably matter most. Let's begin with a typical command:<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n$os=get-wmiobject Win32_OperatingSystem<br \/>\n<\/code><\/p>\n<p>This object has a property called Properties which is a collection of WMI PropertyData objects. I could try something like:<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $os.properties | select name,value<\/p>\n<p>Name                                    Value<br \/>\n----                                    -----<br \/>\nBootDevice                              \\Device\\HarddiskVolume1<br \/>\nBuildNumber                             7601<br \/>\nBuildType                               Multiprocessor Free<br \/>\nCaption                                 Microsoft Windows 7 Ultimate<br \/>\nCodeSet                                 1252<br \/>\nCountryCode                             1<br \/>\n...<br \/>\n<\/code><\/p>\n<p>Sure, I can see the properties and values but I don't really have a good object to work with and this won't help with multiple instances, at least not without a little extra work.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n$d=Get-WmiObject win32_logicaldisk -filter \"drivetype=3\"<br \/>\n$d | foreach {$_.properties | select name,value }<br \/>\n<\/code><\/p>\n<p>And maybe that's all you need. If so, terrific. But I'm looking for an elegant solution. How about expanding the property names and saving them as an array of strings.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n[string[]]$prop=$os.properties | Select -expand name<br \/>\n$os | Select -Property $prop<br \/>\n<\/code><\/p>\n<p>Then I can use them with Select-Object<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $os | Select -Property $prop<\/p>\n<p>PS C:\\> $os | Select -Property $prop<\/p>\n<p>BootDevice                                : \\Device\\HarddiskVolume1<br \/>\nBuildNumber                               : 7601<br \/>\nBuildType                                 : Multiprocessor Free<br \/>\nCaption                                   : Microsoft Windows 7 Ultimate<br \/>\nCodeSet                                   : 1252<br \/>\nCountryCode                               : 1<br \/>\n...<br \/>\n<\/code><\/p>\n<p>That has promise. I could even turn this into a one-line command, assuming I've already defined $os.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n$os | Select -property ([string[]]($os.properties | Select -expand name))<br \/>\n<\/code><\/p>\n<p>If I didn't want to take the extra step, here's a complex alternative:<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nGet-WmiObject win32_OperatingSystem | foreach {<br \/>\n Select -InputObject $_ -Property ([string[]](Select -InputObject $_ -expand Properties | Select -expand Name))<br \/>\n}<br \/>\n<\/code><\/p>\n<p>But this leads to yet another option, using the [WMIClass] type accelerator. When used, PowerShell creates an empty object of the specified WMI class which includes a property list.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> [wmiclass]\"win32_operatingsystem\" | Select -expand Properties | Select name<\/p>\n<p>Name<br \/>\n----<br \/>\nBootDevice<br \/>\nBuildNumber<br \/>\nBuildType<br \/>\nCaption<br \/>\nCodeSet<br \/>\nCountryCode<br \/>\n...<br \/>\n<\/code><\/p>\n<p>This can be further simplified:<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n([wmiclass]\"win32_operatingsystem\").Properties | Select -expand Name<br \/>\n<\/code><\/p>\n<p>In fact, I can use this in an earlier expression to get the same non-System class results.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nget-wmiobject win32_operatingsystem | select -property ([string[]](([wmiclass]\"Win32_Operatingsystem\").properties | select -expand name))<br \/>\n<\/code><\/p>\n<p>I'll admit that's a lot to type. So I need a shortcut. What about turning this into a scriptblock?<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n$p={[string[]](([wmiclass]\"Win32_Operatingsystem\").properties | select -expand name)}<br \/>\n<\/code><\/p>\n<p>When I invoke the scriptblock, I'll get the array of property names. I can now use this in my Get-WMIObject expression:<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nget-wmiobject win32_operatingsystem | select -property (&$p)<br \/>\n<\/code><\/p>\n<p>Definitely easier to type, but limited. I need the scriptblock to be more flexible so it can accommodate other WMI classes.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n$p={Param([string]$class) [string[]](([wmiclass]$class).properties | select -expand name)  }<br \/>\n<\/code><\/p>\n<p>I'll test it in the shell.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> &$p \"win32_bios\"<br \/>\nBiosCharacteristics<br \/>\nBIOSVersion<br \/>\nBuildNumber<br \/>\nCaption<br \/>\nCodeSet<br \/>\nCurrentLanguage<br \/>\n...<br \/>\n<\/code><\/p>\n<p>Excellent! Now for the real deal:<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> get-wmiobject win32_bios | select -property (&$p \"win32_bios\")<\/p>\n<p>BiosCharacteristics   : {4, 7, 8, 9...}<br \/>\nBIOSVersion           : {TOSQCI - 6040000, Ver 1.00PARTTBL}<br \/>\nBuildNumber           :<br \/>\nCaption               : Ver 1.00PARTTBL<br \/>\nCodeSet               :<br \/>\nCurrentLanguage       :<br \/>\nDescription           : Ver 1.00PARTTBL<br \/>\n...<br \/>\n<\/code><\/p>\n<p>That's exactly what I wanted with minimal effort. All I need is to have that scriptblock loaded in my PowerShell session and remember to specify the class name.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nget-wmiobject win32_logicaldisk -filter \"drivetype=3\" | select -property (&$p \"win32_logicaldisk\")<br \/>\n<\/code><\/p>\n<p>Another option would be to turn the scriptblock into a function, but I'll leave that to you.<\/p>\n<p>Naturally this isn't perfect. If I need to query a remote computer with classes that aren't on my computer, this won't work; at least not without some revisions. But since I'd say 90% or more of WMI commands in PowerShell are with the Win32 classes, I think this is a handy trick to stick in your PowerShell toolbox.<\/p>\n<p>If you'd like to try some of my code samples, you can download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/04\/demo-wmiproperties.txt' target='_blank'>demo-wmiproperties<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 properties like Site and Options&#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":[103,534,82,540,547],"class_list":["post-2241","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","category-wmi","tag-get-wmiobject","tag-powershell","tag-scriptblock","tag-scripting","tag-wmi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Skipping WMI System Properties in PowerShell &#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\/2241\/skipping-wmi-system-properties-in-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Skipping WMI System Properties in PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"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 properties like Site and Options...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2012-04-25T13:15:06+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=\"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\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Skipping WMI System Properties in PowerShell\",\"datePublished\":\"2012-04-25T13:15:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/\"},\"wordCount\":465,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Get-WMIObject\",\"PowerShell\",\"ScriptBlock\",\"Scripting\",\"WMI\"],\"articleSection\":[\"PowerShell\",\"Scripting\",\"WMI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/\",\"name\":\"Skipping WMI System Properties in PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2012-04-25T13:15:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2241\\\/skipping-wmi-system-properties-in-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Skipping WMI System Properties in PowerShell\"}]},{\"@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":"Skipping WMI System Properties in PowerShell &#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\/2241\/skipping-wmi-system-properties-in-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Skipping WMI System Properties in PowerShell &#8226; The Lonely Administrator","og_description":"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 properties like Site and Options...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2012-04-25T13:15:06+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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Skipping WMI System Properties in PowerShell","datePublished":"2012-04-25T13:15:06+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/"},"wordCount":465,"commentCount":4,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Get-WMIObject","PowerShell","ScriptBlock","Scripting","WMI"],"articleSection":["PowerShell","Scripting","WMI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/","name":"Skipping WMI System Properties in PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2012-04-25T13:15:06+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Skipping WMI System Properties in PowerShell"}]},{"@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":636,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/636\/select-wmi\/","url_meta":{"origin":2241,"position":0},"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":654,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/","url_meta":{"origin":2241,"position":1},"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":[]},{"id":2555,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2555\/friday-fun-a-gridview-drive-report\/","url_meta":{"origin":2241,"position":2},"title":"Friday Fun: A GridView Drive Report","author":"Jeffery Hicks","date":"November 2, 2012","format":false,"excerpt":"I've been experimenting with different techniques to work with PowerShell in graphical ways, but without resorting to complex solutions such as WinForms or ShowUI. For today's Friday Fun I have a little script that presents a drive usage report using WMI and Out-GridView. As always, my goal with these articles\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\/2012\/11\/gridview-drivereport1-300x159.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1413,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1413\/get-registry-size-and-age\/","url_meta":{"origin":2241,"position":3},"title":"Get Registry Size and Age","author":"Jeffery Hicks","date":"May 4, 2011","format":false,"excerpt":"I'm not sure why the registry has been on my mind lately. I probably need a vacation to get out more. But I put together a relatively simple Windows PowerShell function to retrieve registry statistics that you might find useful. My Get-Registry function will return information about the size of\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\/2011\/05\/registry.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2369,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2369\/get-ip-addresses-with-powershell\/","url_meta":{"origin":2241,"position":4},"title":"Get IP Addresses with PowerShell","author":"Jeffery Hicks","date":"June 6, 2012","format":false,"excerpt":"In celebration of World IPv6 Day, I thought I'd post a little PowerShell code to return IP addresses for a computer. This information is stored in WMI with the Win32_NetworkAdapterConfiguration class. This class will return information about a number of virtual adapters as well so I find it easier to\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/networkcables-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3105,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/3105\/adding-system-path-to-ciminstance-objects\/","url_meta":{"origin":2241,"position":5},"title":"Adding System Path to CIMInstance Objects","author":"Jeffery Hicks","date":"June 13, 2013","format":false,"excerpt":"The other night when I presented for the Mississippi PowerShell Users' Group, one of the members showed some PowerShell 3.0 code using the CIM cmdlets. At issue is how the CIM cmdlets handle the WMI system properties like __SERVER and __RELPATH. By default, those properties aren't displayed, but they are\u2026","rel":"","context":"In &quot;Powershell 3.0&quot;","block_context":{"text":"Powershell 3.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-3-0\/"},"img":{"alt_text":"gcim-systemproperties","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/06\/gcim-systemproperties-1024x362.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/06\/gcim-systemproperties-1024x362.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/06\/gcim-systemproperties-1024x362.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2241","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=2241"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2241\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}