{"id":654,"date":"2010-05-17T14:12:45","date_gmt":"2010-05-17T19:12:45","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/2010\/05\/new-wmi-object\/"},"modified":"2010-05-17T14:12:45","modified_gmt":"2010-05-17T19:12:45","slug":"new-wmi-object","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/","title":{"rendered":"New WMI Object"},"content":{"rendered":"<p>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 New-WmiObject.<\/p>\n<\/p>\n<pre class=\"PowerShellColorizedScript\"><span style=\"color: #00008b\">Function<\/span> <span style=\"color: #8a2be2\">New-WMIObject<\/span> <span style=\"color: #000000\">{<\/span>            \n            \n<span style=\"color: #a9a9a9\">[<\/span><span style=\"color: #add8e6\">cmdletbinding<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #a9a9a9\">]<\/span>            \n            \n<span style=\"color: #00008b\">Param<\/span> <span style=\"color: #000000\">(<\/span>            \n      <span style=\"color: #a9a9a9\">[<\/span><span style=\"color: #add8e6\">Parameter<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #000000\">Position<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #800080\">0<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #000000\">ValueFromPipeline<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #ff4500\">$True<\/span><span style=\"color: #a9a9a9\">,<\/span>            \n      <span style=\"color: #000000\">HelpMessage<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #8b0000\">&quot;Enter a computername.&quot;<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #a9a9a9\">]<\/span>            \n      <span style=\"color: #008080\">[string[]]<\/span><span style=\"color: #ff4500\">$computername<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #ff4500\">$env:computername<\/span><span style=\"color: #a9a9a9\">,<\/span>            \n      <span style=\"color: #a9a9a9\">[<\/span><span style=\"color: #add8e6\">Parameter<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #000000\">Position<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #800080\">1<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #000000\">ValueFromPipeline<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #ff4500\">$False<\/span><span style=\"color: #a9a9a9\">,<\/span>            \n      <span style=\"color: #000000\">HelpMessage<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #8b0000\">&quot;Enter a hashtable of WMI classes and properties.&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span>            \n      <span style=\"color: #000000\">Mandatory<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #ff4500\">$True<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #a9a9a9\">]<\/span>            \n      <span style=\"color: #008080\">[hashtable]<\/span><span style=\"color: #ff4500\">$hashtable<\/span>            \n<span style=\"color: #000000\">)<\/span>            \n            \n<span style=\"color: #00008b\">Begin<\/span> <span style=\"color: #000000\">{<\/span>            \n     <span style=\"color: #0000ff\">write-verbose<\/span> <span style=\"color: #8b0000\">&quot;Starting $($myinvocation.mycommand)&quot;<\/span>            \n<span style=\"color: #000000\">}<\/span><span style=\"color: #006400\">#begin<\/span>            \n            \n<span style=\"color: #00008b\">Process<\/span> <span style=\"color: #000000\">{<\/span>            \n <span style=\"color: #00008b\">foreach<\/span> <span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$computer<\/span> <span style=\"color: #00008b\">in<\/span> <span style=\"color: #ff4500\">$computername<\/span><span style=\"color: #000000\">)<\/span> <span style=\"color: #000000\">{<\/span>            \n <span style=\"color: #006400\">#initialize property hash<\/span>            \n     <span style=\"color: #ff4500\">$properties<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #000000\">@{<\/span><span style=\"color: #000000\">}<\/span>            \n     <span style=\"color: #0000ff\">write-verbose<\/span> <span style=\"color: #8b0000\">&quot;Adding $($computer.toUpper()) to `$properties&quot;<\/span>            \n     <span style=\"color: #ff4500\">$properties<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">Add<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #8b0000\">&quot;Computer&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #000000\">$(<\/span><span style=\"color: #ff4500\">$computer<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">toUpper<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #000000\">)<\/span>            \n    <span style=\"color: #00008b\">foreach<\/span> <span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$hash<\/span> <span style=\"color: #00008b\">in<\/span> <span style=\"color: #ff4500\">$hashtable<\/span><span style=\"color: #000000\">)<\/span> <span style=\"color: #000000\">{<\/span>            \n        <span style=\"color: #ff4500\">$classes<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #ff4500\">$hash<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">keys<\/span>            \n        <span style=\"color: #00008b\">foreach<\/span> <span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$class<\/span> <span style=\"color: #00008b\">in<\/span> <span style=\"color: #ff4500\">$classes<\/span><span style=\"color: #000000\">)<\/span> <span style=\"color: #000000\">{<\/span>            \n            <span style=\"color: #0000ff\">write-verbose<\/span> <span style=\"color: #8b0000\">&quot;Getting $class information on $computer&quot;<\/span>            \n            <span style=\"color: #ff4500\">$wmi<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #0000ff\">Get-WmiObject<\/span> <span style=\"color: #000080\">-Class<\/span> <span style=\"color: #ff4500\">$class<\/span> <span style=\"color: #000080\">-Property<\/span> <span style=\"color: #ff4500\">$hash<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">item<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$class<\/span><span style=\"color: #000000\">)<\/span> <span style=\"color: #000000\">`\n<\/span>            <span style=\"color: #000080\">-computername<\/span> <span style=\"color: #ff4500\">$computer<\/span>            \n            <span style=\"color: #006400\">#create array properties if $wmi returned more than one item<\/span>            \n            <span style=\"color: #00008b\">if<\/span> <span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$wmi<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">count<\/span> <span style=\"color: #a9a9a9\">-gt<\/span> <span style=\"color: #800080\">1<\/span><span style=\"color: #000000\">)<\/span> <span style=\"color: #000000\">{<\/span>            \n                <span style=\"color: #0000ff\">write-verbose<\/span> <span style=\"color: #8b0000\">&quot;Multiple WMI objects returned&quot;<\/span>            \n                <span style=\"color: #006400\">#initialize a temporary array<\/span>            \n                <span style=\"color: #ff4500\">$array<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #000000\">@(<\/span><span style=\"color: #000000\">)<\/span>            \n                <span style=\"color: #00008b\">foreach<\/span> <span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$object<\/span> <span style=\"color: #00008b\">in<\/span> <span style=\"color: #ff4500\">$wmi<\/span><span style=\"color: #000000\">)<\/span> <span style=\"color: #000000\">{<\/span>            \n                    <span style=\"color: #0000ff\">Write-Verbose<\/span> <span style=\"color: #8b0000\">&quot;Adding $($object.__RELPATH)&quot;<\/span>            \n                    <span style=\"color: #ff4500\">$array<\/span><span style=\"color: #a9a9a9\">+=<\/span><span style=\"color: #ff4500\">$object<\/span> <span style=\"color: #a9a9a9\">|<\/span> <span style=\"color: #0000ff\">select<\/span> <span style=\"color: #ff4500\">$hash<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">item<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$class<\/span><span style=\"color: #000000\">)<\/span>            \n                <span style=\"color: #000000\">}<\/span><span style=\"color: #006400\">#end foreach $object<\/span>            \n                <span style=\"color: #006400\">#add the array as a property value<\/span>            \n                <span style=\"color: #006400\">#strip off win32_ from the class name<\/span>            \n                <span style=\"color: #ff4500\">$parsed<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #ff4500\">$class<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">Substring<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$class<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">indexof<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #8b0000\">&quot;_&quot;<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #a9a9a9\">+<\/span><span style=\"color: #800080\">1<\/span><span style=\"color: #000000\">)<\/span>            \n                <span style=\"color: #ff4500\">$properties<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">Add<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$parsed<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #ff4500\">$array<\/span><span style=\"color: #000000\">)<\/span>            \n            <span style=\"color: #000000\">}<\/span>            \n            <span style=\"color: #00008b\">else<\/span> <span style=\"color: #000000\">{<\/span>            \n                <span style=\"color: #006400\">#add each property<\/span>            \n                    <span style=\"color: #00008b\">foreach<\/span> <span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$item<\/span> <span style=\"color: #00008b\">in<\/span> <span style=\"color: #ff4500\">$hash<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">item<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$class<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #000000\">)<\/span> <span style=\"color: #000000\">{<\/span>            \n                    <span style=\"color: #0000ff\">write-verbose<\/span> <span style=\"color: #8b0000\">&quot;Adding $item = $($wmi.($item))&quot;<\/span>            \n                    <span style=\"color: #ff4500\">$properties<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">Add<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$item<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #000000\">$(<\/span><span style=\"color: #ff4500\">$wmi<\/span><span style=\"color: #a9a9a9\">.<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #ff4500\">$item<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #000000\">)<\/span><span style=\"color: #000000\">)<\/span>            \n            <span style=\"color: #000000\">}<\/span>            \n            <span style=\"color: #000000\">}<\/span> <span style=\"color: #006400\">#else<\/span>            \n        <span style=\"color: #000000\">}<\/span> <span style=\"color: #006400\">#foreach $class<\/span>            \n                \n    <span style=\"color: #000000\">}<\/span> <span style=\"color: #006400\">#foreach $hash<\/span>            \n    <span style=\"color: #0000ff\">Write-Verbose<\/span> <span style=\"color: #8b0000\">&quot;Creating custom object&quot;<\/span>            \n    <span style=\"color: #0000ff\">New-Object<\/span> <span style=\"color: #8a2be2\">PSObject<\/span> <span style=\"color: #000080\">-Property<\/span> <span style=\"color: #ff4500\">$properties<\/span>            \n <span style=\"color: #000000\">}<\/span> <span style=\"color: #006400\">#foreach $computer<\/span>            \n<span style=\"color: #000000\">}<\/span> <span style=\"color: #006400\">#process<\/span>            \n            \n<span style=\"color: #00008b\">End<\/span> <span style=\"color: #000000\">{<\/span>            \n             \n <span style=\"color: #0000ff\">write-verbose<\/span> <span style=\"color: #8b0000\">&quot;Ending $($myinvocation.mycommand)&quot;<\/span>            \n<span style=\"color: #000000\">}<\/span> <span style=\"color: #006400\">#end<\/span>            \n<span style=\"color: #000000\">}<\/span> <span style=\"color: #006400\">#end function<\/span><\/pre>\n<\/p>\n<p>The function takes a computername as either a direct or pipelined value. The default is the local computer. The other value is a hashtable of WMI information. The key is the name of a Win32 WMI class. The value is a comma separated list of properties for that particular class. The function will gather the requested WMI information and write a custom object to the pipeline with each property. This means that you are limited to unique property names in your hashtable. If you have two classes you want to query, each with a property of Version, the function can\u2019t return both values. If someone would like to revise the script to accommodate this that would be great.<\/p>\n<p>The function works best if the WMI classes return single instances. If the WMI class you want to query will return multiple instances, New-WmiObject will work but it will return a property that contains an array of the objects. For example. here\u2019s a hash table I want to use:<\/p>\n<\/p>\n<pre class=\"PowerShellColorizedScript\"><span style=\"color: #ff4500\">$a<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #000000\">@{<\/span><span style=\"color: #000000\">win32_OperatingSystem<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #8b0000\">&quot;Caption&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #8b0000\">&quot;RegisteredUser&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #8b0000\">&quot;LastBootUpTime&quot;<\/span><span style=\"color: #000000\">;<\/span>            \n<span style=\"color: #000000\">win32_computersystem<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #8b0000\">&quot;Name&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #8b0000\">&quot;Manufacturer&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #8b0000\">&quot;Model&quot;<\/span><span style=\"color: #000000\">;<\/span>            \n<span style=\"color: #000000\">win32_bios<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #8b0000\">&quot;Version&quot;<\/span><span style=\"color: #000000\">;<\/span>            \n<span style=\"color: #000000\">win32_logicaldisk<\/span><span style=\"color: #a9a9a9\">=<\/span><span style=\"color: #8b0000\">&quot;deviceid&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #8b0000\">&quot;size&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #8b0000\">&quot;freespace&quot;<\/span><span style=\"color: #a9a9a9\">,<\/span><span style=\"color: #8b0000\">&quot;drivetype&quot;<\/span><span style=\"color: #000000\">}<\/span><\/pre>\n<\/p>\n<p>After loading the function into my shell I can run it like this:<\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">PS C:\\&gt; new-wmiobject \u2013hashtable $a<\/font><\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">RegisteredUser : Jeff<br \/>\n    <br \/>Version&#160;&#160;&#160;&#160;&#160;&#160;&#160; : TOSQCI - 6040000 <\/p>\n<p>Model&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : Qosmio X505 <\/p>\n<p>LastBootUpTime : 20100514111336.610798-240 <\/p>\n<p>Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : SERENITY <\/p>\n<p>logicaldisk&#160;&#160;&#160; : {@{deviceid=C:; size=487439986688; freespace=276030799872; dri <\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vetype=3}, @{deviceid=D:; size=; freespace=; drivetype=5}, @{d <\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; eviceid=E:; size=1000202039296; freespace=504326586368; drivet <\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ype=3}, @{deviceid=F:; size=; freespace=; drivetype=5}...} <\/p>\n<p>Manufacturer&#160;&#160; : TOSHIBA <\/p>\n<p>Caption&#160;&#160;&#160;&#160;&#160;&#160;&#160; : Microsoft Windows 7 Ultimate <\/p>\n<p>Computer&#160;&#160;&#160;&#160;&#160;&#160; : SERENITY<\/font><\/p>\n<p>Notice the Win32_logicaldisk entry from the hashtable is used to define a property name for the collection by stripping off WIn32_. Working with individual properties of the custom object should be pretty straightforward. <\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">PS C:\\&gt; $r | format-table Computer,Caption,Model -AutoSize <\/font><\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">Computer Caption&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Model&#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 \/>-------- -------&#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 \/>GODOT7&#160;&#160; Microsoft Windows 7 Ultimate&#160; Latitude D800&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br \/>SERENITY Microsoft Windows 7 Ultimate&#160; Qosmio X505&#160;&#160; <\/font><\/p>\n<p>If you want to work with the array properties, like logicaldisk in my example, you could try an expression like this:<\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">PS C:\\Scripts&gt; $r | select-object -property computer -expand logicaldisk |<br \/>\n    <br \/>where {$_.drivetype -eq 3} | format-table -GroupBy Computer -Property DeviceID,Size,FreeSpace <\/font><\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">&#160;&#160; Computer: GODOT7 <\/font><\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">DeviceId&#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; Size&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FreeSpace<br \/>\n    <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;&#160;&#160;&#160;&#160; --------- <\/p>\n<p>C:&#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; 119926681600&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 45238063104 <\/font><\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">&#160;&#160; Computer: SERENITY <\/font><\/p>\n<p><font color=\"#0000ff\" face=\"Consolas\">DeviceId&#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; Size&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FreeSpace<br \/>\n    <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;&#160;&#160;&#160;&#160; --------- <\/p>\n<p>C:&#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; 487439986688&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 276032737280 <\/p>\n<p>E:&#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; 1000202039296&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 504326586368 <\/p>\n<p>J:&#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; 320070287360&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 91348078592<\/font><\/p>\n<p>I think this function will work just fine as long as you stick to a few classes that return single instances and if you can limit yourself to unique WMI property names. The function has plenty of room for improvement as it is lacking comment based help, support for alternate credentials, and error handling. If you work up a new version I\u2019d be happy to post it.<\/p>\n<div style=\"padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px\" id=\"scid:F60BB8FA-6F02-4999-8F5E-9DD4E92C4DA7:8de650ca-b280-4ac1-b7c1-d6072d7eb14d\" class=\"wlWriterEditableSmartContent\">\n<div><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/05\/NewWMIObject.txt\" target=\"_blank\">Download the PowerShell script file.<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 New-WmiObject. Function New-WMIObject { [cmdletbinding()]&#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,19],"tags":[32,144,534,540,547],"class_list":["post-654","post","type-post","status-publish","format-standard","hentry","category-powershell","category-wmi","tag-functions","tag-objects","tag-powershell","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>New WMI Object &#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\/654\/new-wmi-object\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New WMI Object &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"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 New-WmiObject. Function New-WMIObject { [cmdletbinding()]...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2010-05-17T19:12:45+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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"New WMI Object\",\"datePublished\":\"2010-05-17T19:12:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/\"},\"wordCount\":481,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"functions\",\"objects\",\"PowerShell\",\"Scripting\",\"WMI\"],\"articleSection\":[\"PowerShell\",\"WMI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/\",\"name\":\"New WMI Object &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2010-05-17T19:12:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/654\\\/new-wmi-object\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New WMI Object\"}]},{\"@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":"New WMI Object &#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\/654\/new-wmi-object\/","og_locale":"en_US","og_type":"article","og_title":"New WMI Object &#8226; The Lonely Administrator","og_description":"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 New-WmiObject. Function New-WMIObject { [cmdletbinding()]...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/","og_site_name":"The Lonely Administrator","article_published_time":"2010-05-17T19:12:45+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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"New WMI Object","datePublished":"2010-05-17T19:12:45+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/"},"wordCount":481,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["functions","objects","PowerShell","Scripting","WMI"],"articleSection":["PowerShell","WMI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/","name":"New WMI Object &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2010-05-17T19:12:45+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"New WMI Object"}]},{"@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":654,"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":2241,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/","url_meta":{"origin":654,"position":1},"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":1687,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1687\/filter-left\/","url_meta":{"origin":654,"position":2},"title":"Filter Left","author":"Jeffery Hicks","date":"October 14, 2011","format":false,"excerpt":"When writing WMI queries expressions in Windows PowerShell, it is recommended to use WMI filtering, as opposed to getting objects and then filtering with Where-Object. I see expressions like this quite often: [cc lang=\"PowerShell\"] get-wmiobject win32_process -computer $c | where {$_.name -eq \"notepad.exe\"} [\/cc] In this situation, ALL process objects\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1806,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1806\/wmi-powershell-tricks-for-windows-server\/","url_meta":{"origin":654,"position":3},"title":"WMI PowerShell Tricks for Windows Server&#8230;","author":"Jeffery Hicks","date":"November 15, 2011","format":false,"excerpt":"WMI PowerShell Tricks for Windows Server Management*My first article for @petri_co_il on WMI PowerShell Tricks http:\/\/bit.ly\/rx1YrD Get-WMIObject - PowerShell Tricks Windows Server Management Get-WMIObject in Windows Powershell makes it easier to utilize Windows Management Instrumentation (WMI) and makes managing windows servers much easier.","rel":"","context":"In &quot;Google Plus&quot;","block_context":{"text":"Google Plus","link":"https:\/\/jdhitsolutions.com\/blog\/category\/google-plus\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8541,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8541\/getting-ciminstance-by-path\/","url_meta":{"origin":654,"position":4},"title":"Getting CIMInstance by Path","author":"Jeffery Hicks","date":"August 20, 2021","format":false,"excerpt":"I am a member of the PowerShell Cmdlet Working Group. We've been looking into this issue and it is an intriguing one. Enough so that I spent some time looking into it and writing up some test code. If you work with WMI\/CIM this might be of interest to you.\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\/2021\/08\/add-ciminstancepath2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/add-ciminstancepath2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/add-ciminstancepath2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/add-ciminstancepath2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1625,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1625\/get-process-owner\/","url_meta":{"origin":654,"position":5},"title":"Get Process Owner","author":"Jeffery Hicks","date":"August 25, 2011","format":false,"excerpt":"I've been working on my second training course for Train Signal on managing Windows Server 2008 with Windows PowerShell, specifically the lesson on managing processes. I thought I'd share a little tidbit I worked out. In fact, I hope you'll stay tuned for other little goodies over the next several\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\/654","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=654"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/654\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}