{"id":8196,"date":"2021-02-24T11:28:50","date_gmt":"2021-02-24T16:28:50","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8196"},"modified":"2021-02-24T11:28:53","modified_gmt":"2021-02-24T16:28:53","slug":"comparing-powershell-property-names","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/","title":{"rendered":"Comparing PowerShell Property Names"},"content":{"rendered":"\n<div class=\"wp-block-image is-style-default\"><figure class=\"alignleft size-large\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"213\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg\" alt=\"\" class=\"wp-image-8197\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg 320w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707-300x200.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>Recently, I was chatting with my friend Gladys Kravitz about the hassle of comparing objects in PowerShell. Even after all these years. She has a specific use case, but you might also feel the need for a better comparison option. And to be clear, the comparison we're talking about is not the object's values, as you might see with Compare-Object. But rather the <em>property names<\/em>. <\/p>\n\n\n\n<p>In Gladys' situation, she imports data from CSV files which she processes through her scripts to get things done. Her use-case is to compare property names. Does this CSV file have the same property names as that CSV file? Are there extra properties? Or is something missing? So let's see how we might address this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Think Objects<\/h2>\n\n\n\n<p>Even though we're starting with CSV files, we're really talking about objects. Gladys can import her CSV files and turn them into custom objects. You might be creating objects to compare through some other mechanism. The bottom line is that we should look at this as an object comparison problem, not a file problem.<\/p>\n\n\n\n<p>Let me start by generating some sample data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$csvA\u00a0=\u00a0@\"\nsamantha,darren-1,darren-2,tabitha,esmerelda\n1,2,3,4,5\n2,4,6,8,10\n3,6,9,11,12\n11,22,33,44,55\n\"@\n\n$csvB\u00a0=\u00a0@\"\nsamantha,darren-1,darren-2,esmerelda,gladys,agatha\n1,2,3,4,0,9\n2,4,6,8,1,8\n3,6,9,11,8,0\n11,22,33,55,66,77\n\"@\n\n$a\u00a0=\u00a0$csvA\u00a0|\u00a0ConvertFrom-Csv\n$b\u00a0=\u00a0$csvB\u00a0|\u00a0ConvertFrom-Csv<\/code><\/pre>\n\n\n\n<p>For my purposes $A is the reference object and the $B is the difference object. In looking at the data you can see the $B is missing \"tabitha\" and has extra properties \"agatha\" and \"gladys\". I don't care about the values. We even don't really care about the order of property names because one we have an object we're going to reference by property name, not its position in the CSV header.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PSObject<\/h2>\n\n\n\n<p>To compare object property names, we don't need the entire object. All we need is one item to analyze because the property names are the same for objects. PowerShell goes to a lot of effort to make it easy to use for IT Pros. PowerShell hides a lot of the .NET sausage-making so you only have to work with the final results. But sometimes, we need to get our hands dirty. In this case, we're going to use a ubiquitous property called PSObject.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"212\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-1-1024x212.png\" alt=\"\" class=\"wp-image-8198\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-1-1024x212.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-1-300x62.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-1-768x159.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-1-1536x318.png 1536w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-1-2048x424.png 2048w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-1-850x176.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>We're going to use the Properties property. Here's what it looks like.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-property-sample.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"410\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-property-sample-1024x410.png\" alt=\"\" class=\"wp-image-8199\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-property-sample-1024x410.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-property-sample-300x120.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-property-sample-768x307.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-property-sample-850x340.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/psobject-property-sample.png 1229w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>It is easy then to create a list of property names for the reference and difference objects.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$refProp\u00a0=\u00a0$a[0].psobject.properties.name\u00a0|\u00a0Sort-Object\n$diffProp\u00a0=\u00a0$b[0].psobject.properties.name\u00a0|\u00a0Sort-Object<\/code><\/pre>\n\n\n\n<p>Then I can go through each list and see what properties are missing or extra.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\"><em>#find\u00a0extra\u00a0\u00a0properties\u00a0in\u00a0the\u00a0difference\u00a0object<\/em>\nforeach\u00a0($name\u00a0in\u00a0$diffProp)\u00a0{\n\u00a0\u00a0\u00a0\u00a0if\u00a0($refProp\u00a0-notcontains\u00a0$name)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$name\n\u00a0\u00a0\u00a0\u00a0}\n}\u00a0<em>#foreach<\/em>\n\n<em>#find\u00a0missing\u00a0reference\u00a0properties\u00a0from\u00a0the\u00a0difference\u00a0object<\/em>\nforeach\u00a0($name\u00a0in\u00a0$refProp)\u00a0{\n\u00a0\u00a0\u00a0\u00a0if\u00a0($diffProp\u00a0-notcontains\u00a0$name)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$name\n\u00a0\u00a0\u00a0\u00a0}\n}\u00a0<em>#foreach<\/em><\/code><\/pre>\n\n\n\n<p>Of course, I want to create a meaningful result so that Gladys can tell at a glance how things compare. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Compare-PropertyName<\/h2>\n\n\n\n<p>Here's the PowerShell function I wrote.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Function\u00a0Compare-PropertyName\u00a0{\n\u00a0\u00a0\u00a0\u00a0[cmdletbinding(<em>DefaultParameterSetName<\/em>=\"default\")]\n\u00a0\u00a0\u00a0\u00a0[alias(\"cpn\")]\n\u00a0\u00a0\u00a0\u00a0[Outputtype(\"PSPropertyNameDifference\",\"string\",\"boolean\")]\n\u00a0\u00a0\u00a0\u00a0Param(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[Parameter(<em>Position<\/em>\u00a0=\u00a00,\u00a0<em>Mandatory<\/em>)]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[ValidateNotNullOrEmpty()]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[object]$Reference,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[Parameter(<em>Position<\/em>\u00a0=\u00a01,\u00a0<em>Mandatory<\/em>)]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[ValidateNotNullOrEmpty()]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[object]$Difference,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[Parameter(<em>HelpMessage<\/em>\u00a0=\u00a0\"Indicate\u00a0if\u00a0property\u00a0names\u00a0match\u00a0with\u00a0a\u00a0simple\u00a0True\/False.\",<em>ParameterSetName<\/em>=\"quiet\")]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[switch]$Quiet,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[Parameter(<em>HelpMessage<\/em>\u00a0=\u00a0\"Only\u00a0show\u00a0missing\u00a0property\u00a0names\u00a0in\u00a0the\u00a0difference\u00a0object.\",<em>ParameterSetName<\/em>=\"missing\")]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[switch]$MissingOnly,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[Parameter(<em>HelpMessage<\/em>\u00a0=\u00a0\"Only\u00a0show\u00a0extra\u00a0property\u00a0names\u00a0in\u00a0the\u00a0difference\u00a0object.\",<em>ParameterSetName<\/em>=\"extra\")]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[switch]$ExtraOnly\n\u00a0\u00a0\u00a0\u00a0)\n\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0property\u00a0names\u00a0from\u00a0the\u00a0first\u00a0item<\/em>\n\u00a0\u00a0\u00a0\u00a0$refProp\u00a0=\u00a0$Reference[0].psobject.properties.name\u00a0|\u00a0Sort-Object\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Found\u00a0$(($refProp).count)\u00a0reference\u00a0properties\"\n\n\u00a0\u00a0\u00a0\u00a0$diffProp\u00a0=\u00a0$Difference[0].psobject.properties.name\u00a0|\u00a0Sort-Object\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Found\u00a0$(($diffProp).\u00a0count)\u00a0difference\u00a0properties\"\n\n\u00a0\u00a0\u00a0\u00a0$missing\u00a0=\u00a0[System.Collections.Generic.List[string]]::new()\n\u00a0\u00a0\u00a0\u00a0$extra\u00a0=\u00a0[System.Collections.Generic.List[string]]::new()\n\n\u00a0\u00a0\u00a0\u00a0<em>#find\u00a0extra\u00a0\u00a0properties\u00a0in\u00a0the\u00a0difference\u00a0object<\/em>\n\u00a0\u00a0\u00a0\u00a0foreach\u00a0($name\u00a0in\u00a0$diffProp)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($refProp\u00a0-notcontains\u00a0$name)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"$Name\u00a0not\u00a0found\u00a0in\u00a0the\u00a0reference\u00a0object\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$extra.Add(\u00a0$name)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\u00a0<em>#foreach<\/em>\n\n\u00a0\u00a0\u00a0\u00a0<em>#find\u00a0missing\u00a0reference\u00a0properties\u00a0from\u00a0the\u00a0difference\u00a0object<\/em>\n\u00a0\u00a0\u00a0\u00a0foreach\u00a0($name\u00a0in\u00a0$refProp)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($diffProp\u00a0-notcontains\u00a0$name)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"$Name\u00a0not\u00a0found\u00a0in\u00a0the\u00a0difference\u00a0object\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$missing.Add(\u00a0$name)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\u00a0<em>#foreach<\/em>\n\n\u00a0\u00a0\u00a0\u00a0<em>#create\u00a0a\u00a0custom\u00a0object\u00a0for\u00a0the\u00a0reseult<\/em>\n\u00a0\u00a0\u00a0\u00a0$result\u00a0=\u00a0[pscustomobject]@{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSTypename\u00a0=\u00a0\"PSPropertyNameDifference\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Missing\u00a0=\u00a0$missing\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Extra\u00a0=\u00a0$Extra\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ReferenceProperties\u00a0=\u00a0$refProp\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0DifferenceProperties\u00a0=\u00a0$diffProp\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ReferenceCount\u00a0=\u00a0$refProp.count\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0DifferenceCount\u00a0=\u00a0$diffProp.count\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0switch\u00a0($pscmdlet.ParameterSetName)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Quiet\"\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($result.missing.count\u00a0-eq\u00a00\u00a0-AND\u00a0$result.extra.count\u00a0-eq\u00a00)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$true\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$false\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Missing\"\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$result.Missing\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Extra\"\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$result.Extra\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Default\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$result\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\u00a0<em>#switch<\/em>\n\n\n}\u00a0<em>#close\u00a0function<\/em><\/code><\/pre>\n\n\n\n<p>The function generates one type of object by default.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"313\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname1-1024x313.png\" alt=\"\" class=\"wp-image-8201\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname1-1024x313.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname1-300x92.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname1-768x235.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname1-850x260.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname1.png 1489w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>But I also wanted to offer alternatives that would give Gladys information she might want quickly.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"325\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname2-1024x325.png\" alt=\"\" class=\"wp-image-8202\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname2-1024x325.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname2-300x95.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname2-768x244.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname2-1536x488.png 1536w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname2-850x270.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/compare-propertyname2.png 1660w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>The results are all relative to the difference object. The difference object, $b, is missing the property \"tabitha\", for example.<\/p>\n\n\n\n<p>I'd love to hear how this works for you. I think this will make a good addition to the <a href=\"https:\/\/github.com\/jdhitsolutions\/PSScriptTools\" target=\"_blank\" rel=\"noreferrer noopener\">PSScriptTools <\/a>module so look for an update in the next few weeks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I was chatting with my friend Gladys Kravitz about the hassle of comparing objects in PowerShell. Even after all these years. She has a specific use case, but you might also feel the need for a better comparison option. And to be clear, the comparison we&#8217;re talking about is not the object&#8217;s values, as&#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: Comparing #PowerShell Property Names","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[344,224,534,650],"class_list":["post-8196","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-compare-object","tag-function","tag-powershell","tag-psobject"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Comparing PowerShell Property Names &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"Sometimes in PowerShell we want to know what property names are different between objects. Here&#039;s how I built a function for that task.\" \/>\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\/8196\/comparing-powershell-property-names\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Comparing PowerShell Property Names &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Sometimes in PowerShell we want to know what property names are different between objects. Here&#039;s how I built a function for that task.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-24T16:28:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-24T16:28:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg\" \/>\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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Comparing PowerShell Property Names\",\"datePublished\":\"2021-02-24T16:28:50+00:00\",\"dateModified\":\"2021-02-24T16:28:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/\"},\"wordCount\":505,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/pexels-daniel-reche-1556707.jpg\",\"keywords\":[\"Compare-Object\",\"Function\",\"PowerShell\",\"PSObject\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/\",\"name\":\"Comparing PowerShell Property Names &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/pexels-daniel-reche-1556707.jpg\",\"datePublished\":\"2021-02-24T16:28:50+00:00\",\"dateModified\":\"2021-02-24T16:28:53+00:00\",\"description\":\"Sometimes in PowerShell we want to know what property names are different between objects. Here's how I built a function for that task.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/pexels-daniel-reche-1556707.jpg\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/pexels-daniel-reche-1556707.jpg\",\"width\":320,\"height\":213},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8196\\\/comparing-powershell-property-names\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Comparing PowerShell Property Names\"}]},{\"@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":"Comparing PowerShell Property Names &#8226; The Lonely Administrator","description":"Sometimes in PowerShell we want to know what property names are different between objects. Here's how I built a function for that task.","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\/8196\/comparing-powershell-property-names\/","og_locale":"en_US","og_type":"article","og_title":"Comparing PowerShell Property Names &#8226; The Lonely Administrator","og_description":"Sometimes in PowerShell we want to know what property names are different between objects. Here's how I built a function for that task.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-02-24T16:28:50+00:00","article_modified_time":"2021-02-24T16:28:53+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg","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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Comparing PowerShell Property Names","datePublished":"2021-02-24T16:28:50+00:00","dateModified":"2021-02-24T16:28:53+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/"},"wordCount":505,"commentCount":8,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg","keywords":["Compare-Object","Function","PowerShell","PSObject"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/","name":"Comparing PowerShell Property Names &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg","datePublished":"2021-02-24T16:28:50+00:00","dateModified":"2021-02-24T16:28:53+00:00","description":"Sometimes in PowerShell we want to know what property names are different between objects. Here's how I built a function for that task.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-daniel-reche-1556707.jpg","width":320,"height":213},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8196\/comparing-powershell-property-names\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Comparing PowerShell Property Names"}]},{"@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":8465,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8465\/filtering-powershell-unique-objects\/","url_meta":{"origin":8196,"position":0},"title":"Filtering for Unique Objects in PowerShell","author":"Jeffery Hicks","date":"July 1, 2021","format":false,"excerpt":"A few weeks ago my friend, Gladys Kravitz, was lamenting about a challenge related to filtering for unique objects. PowerShell has a Get-Unique cmdlet, and Select-Object has a -Unique parameter, but these options are limited. On one hand, I'd say most things we manage with PowerShell are guaranteed to be\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\/07\/2021-07-01_12-55-46.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8916,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8916\/managing-raw-directorysearcher-data\/","url_meta":{"origin":8196,"position":1},"title":"Managing Raw DirectorySearcher Data","author":"Jeffery Hicks","date":"February 24, 2022","format":false,"excerpt":"Recently, I was chatting with my friend Gladys. As part of her work, she often creates Active Directory PowerShell-related tools for her colleagues. It is always good to be the toolmaker! Anyway, she doesn't want to rely on the Active Directory module from Remote Server Administration Tools (RSAT). There's no\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\/2022\/02\/resultpropertiescollection.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/resultpropertiescollection.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/resultpropertiescollection.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/resultpropertiescollection.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7193,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7193\/better-event-logs-with-powershell\/","url_meta":{"origin":8196,"position":2},"title":"Better Event Logs with PowerShell","author":"Jeffery Hicks","date":"January 24, 2020","format":false,"excerpt":"Because I don't work in a corporate environment, I don't always see opportunities where PowerShell can make your life better as an IT professional. I have a friend -- let's call her Gladys Kravitz. Gladys and I were chatting and she mentioned how tricky it is to pull information out\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":7700,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7700\/active-directory-objects-and-the-powershell-pipeline\/","url_meta":{"origin":8196,"position":3},"title":"Active Directory Objects and the PowerShell Pipeline","author":"Jeffery Hicks","date":"September 28, 2020","format":false,"excerpt":"This article is something I've been meaning to write for sometime. As often as I tell people PowerShell is easy to use once you understand its core concepts, that isn't always the case.\u00a0 This is a problem my friend Gladys Kravitz brought to my attention some time ago. Like her,\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\/2020\/09\/Get-bits-revised-ad.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":5143,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5143\/compare-powershell-modules\/","url_meta":{"origin":8196,"position":4},"title":"Compare PowerShell Modules","author":"Jeffery Hicks","date":"June 29, 2016","format":false,"excerpt":"One of the attractive features in PowerShell v5 is PowerShellGet. This module includes commands which makes it easy to discover and install PowerShell modules from the Internet, or even your network. The modules are stored in online repositories. Microsoft maintains one called PSGallery. Typically you will use PowerShell commands to\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"Comparing module versions","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-26.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-26.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-26.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1900,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1900\/friday-fun-is-it-today\/","url_meta":{"origin":8196,"position":5},"title":"Friday Fun Is It Today?","author":"Jeffery Hicks","date":"December 16, 2011","format":false,"excerpt":"I was testing out the PowerShell cmdlets that ship with Backup and Replication from Veeam Software. I was using the cmdlet to return backup jobs and realized I needed a way to only get those objects where the date was today. Because the property was a complete date time object,\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8196","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=8196"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8196\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}