<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export Compliance Reports in vSphere Update Manager PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413725#M71</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always run a &lt;A href="http://pubs.vmware.com/vsphere-51/topic/com.vmware.powercli.vum_cmd.doc/Scan-Inventory.html"&gt;Scan-Inventory&lt;/A&gt; from the script.&lt;/P&gt;&lt;P&gt;That way it will always produce a result, even if there was no scan done before your script runs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jul 2013 19:16:46 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2013-07-25T19:16:46Z</dc:date>
    <item>
      <title>Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413699#M45</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are looking to get a report of missing patches and such from our hosts. I found this &lt;A _jive_internal="true" href="https://communities.vmware.com/docs/DOC-14180"&gt;document &lt;/A&gt;from bbambalova, and wanted to see if anyone could assist me with it. From what I can tell, right now this script will run against ALL hosts found via the $vmHosts = Get-VMHost variable. We want to be able to run this against a specific set of hosts or even select clusters only; not the entire environment. I have tested with the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$vmHosts = Get-Content "C:\esxihosts.txt"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within that text file, I have a few hostnames that I'd like to run the report against. When I run the script (ExportCompliance.ps1 $vmHOsts "C:\Reports\"), I get the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cannot process argument transformation on parameter 'inventoryItems'. Cannot convert the "esx1.host.com" value of type "system.String" to type "VMware.VimAutomation.ViCore.Types.V1.Inventory.InventoryItem[]".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way I can set this up to run as I'd like? Or is there a better way to go about accomplishing my goal? Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:14:39 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413699#M45</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-19T19:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413700#M46</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nearly there, you will have to provide the script with the actual objects, not the names.&lt;/P&gt;&lt;P&gt;So try it like this&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;ExportCompliance.ps1 (Get-VMHost -Name $vmHosts) "C:\Reports\"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:36:32 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413700#M46</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-07-19T19:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413701#M47</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh cool! Thank you LucD!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when I run this, nothing terrible will happen correct? This will ONLY run the report against whatever I have in the esxihosts.txt file right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:46:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413701#M47</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-19T19:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413702#M48</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:47:22 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413702#M48</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-07-19T19:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413703#M49</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again LucD, it worked perfectly &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a followup, do you know of a way to modify the powershell script to include only certain patch types? For example, the output now will show the Patch Compliance column with values of Compliant, Not Compliant, Not Applicable, etc. Similar to what is found when looking at the summary in Update Manager. Can this be filtered to show say Compliant and Not Compliant only?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 20:42:52 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413703#M49</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-23T20:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413704#M50</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks LucD. The script worked. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 20:53:06 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413704#M50</guid>
      <dc:creator>obireb</dc:creator>
      <dc:date>2013-07-23T20:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413705#M51</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately the &lt;STRONG&gt;ComplianceStatus&lt;/STRONG&gt; parameter only accepts 1 value.&lt;/P&gt;&lt;P&gt;But you can filter the ones you require after the Get-Compliance cmdlet with a Where-clause.&lt;/P&gt;&lt;P&gt;Something like this&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;$compliances = Get-Compliance -Entity $inventoryItem -Detailed&lt;SPAN style="color: #008000;"&gt; |&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where {"Compliant","NonCompliant" -contains $_.Status}&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 22:01:50 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413705#M51</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-07-23T22:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413706#M52</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added in the code you suggested, but it unfortunately still outputs the same. Any idea what else I could try? Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 13:56:19 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413706#M52</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-24T13:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413707#M53</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Strange, can you try (just take whatever entity for which you know the status is not Compliant or NonCompliant.&lt;/P&gt;&lt;P&gt;Then do&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-Compliance -Entity $entity | Select Status&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 14:06:53 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413707#M53</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-07-24T14:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413708#M54</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again LucD. I think I will leave that script as-is for a detailed view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You did get me thinking though. If I run:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13746913067432296" jivemacro_uid="_13746913067432296"&gt;
&lt;P&gt;$Get-Compliance -Entity servername -Detailed&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a decent output showing a summary view. This may actually be ideal for what I'm doing. How can I output this into a text file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another followup! Am I correct in this script will only output results if there is an existing scan?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 14:34:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413708#M54</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-24T14:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413709#M55</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can just direct it to a text file with the Out-File cmdlet.&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-Compliance -Entity servername -Detailed&amp;nbsp; | Out-File C:\compliance.txt&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P&gt;But that will also give you the default output (selected properties, the way they are displayed...).&lt;/P&gt;&lt;P&gt;If you want more control over the output, you can first direct the objects to the Select-Object cmdlet and then write them for example to a CSV file.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-Compliance -Entity $esx -Detailed |&lt;/P&gt;
&lt;P&gt;Select @{N="EntityName";E={$_.Entity.Name}},&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="Baseline";E={$_.Baseline.Name}},&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status |&lt;/P&gt;
&lt;P&gt;Export-Csv C:\compliance.csv -NoTypeInformation -UseCulture&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 16:05:03 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413709#M55</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-07-24T16:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413710#M56</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You've been really helpful here LucD, I really appreciate your help and patience &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; In addition to getting the detailed view, I'm also working on this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_13746899675149174 jive_text_macro jive_macro_code" jivemacro_uid="_13746899675149174" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;Get-Compliance -Entity $inventoryItem -Detailed | Sort-Object -Property Entity | Format-Table -AutoSize | &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Out-String -Width 5000 | Out-File "$path\PatchComplianceReport_$CurrentDate.txt"&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That outputs great in a text file. However, is there any way that I can output that to a .csv? I've tried changing Out-File to Export-Csv, but it did not like that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 18:24:50 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413710#M56</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-24T18:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413711#M57</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is in fact what my 2nd example in my previous answer is doing.&lt;/P&gt;&lt;P&gt;You only need to output the object to the Select-Object cmdlet, where you specify which properties to show, and then the result goes to the CSV file with the Export-Csv cmdlet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming back to your TXT file lines, you can simplify that a bit.&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-Compliance -Entity $inventoryItem -Detailed |&lt;/P&gt;
&lt;P&gt;Out-File "$path\PatchComplianceReport_$CurrentDate.txt" -Width 5000&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P&gt;The Format-Table cmdlet is intended for screen output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Sort is not needed on Entity, since the Get-Compliance can only accept one entity on each call.&lt;/P&gt;&lt;P&gt;You could sort on the Basline name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 18:54:34 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413711#M57</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-07-24T18:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413712#M58</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I feel like I'm getting closer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the first one, I've added this code:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13746943525637987" jivemacro_uid="_13746943525637987"&gt;
&lt;P&gt;Get-Compliance -Entity $inventoryItem -Detailed |&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Select @{N="EntityName";E={$_.Entity.Name}},&lt;/P&gt;
&lt;P&gt;&amp;nbsp; @{N="Baseline";E={$_.Baseline.Name}},&lt;/P&gt;
&lt;P&gt;&amp;nbsp; @{N="Compliant Patches";E={$_.CompliantPatches.Name}},&lt;/P&gt;
&lt;P&gt;&amp;nbsp; @{N="Not Compliant Patches";E={$_.NotCompliantPatches.Name}},&lt;/P&gt;
&lt;P&gt;&amp;nbsp; @{N="Unknown Patches";E={$_.UnknownPatches.Name}},&lt;/P&gt;
&lt;P&gt;&amp;nbsp; @{N="Not Applicable Patches";E={$_.NotApplicablePatches.Name}},&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Status |&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Export-Csv "$path\PatchComplianceReport_$CurrentDate.csv" -UseCulture&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I do that, it will output to a CSV file with the correct headings. However there are no numerical values &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.vmware.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for the plain text file, when I simplify it as you mention it truncates the text. Is there a way to have it display in formatted columns?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 19:33:39 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413712#M58</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-24T19:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413713#M59</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get the numbers you will have to use the Measure-Object cmdlet.&lt;/P&gt;&lt;P&gt;Like this&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-Compliance -Entity $inventoryItem -Detailed |&lt;/P&gt;
&lt;P&gt;Select @{N="EntityName";E={$_.Entity.Name}},&lt;/P&gt;
&lt;P&gt;@{N="Baseline";E={$_.Baseline.Name}},&lt;/P&gt;
&lt;P&gt;@{N="Compliant Patches";E={$_.CompliantPatches&lt;SPAN style="color: #008000;"&gt; | Measure-Object | Select -ExpandProperty Count&lt;/SPAN&gt;}},&lt;/P&gt;
&lt;P&gt;@{N="Not Compliant Patches";E={$_.NotCompliantPatches | Measure-Object | Select -ExpandProperty Count}},&lt;/P&gt;
&lt;P&gt;@{N="Unknown Patches";E={$_.UnknownPatches | Measure-Object | Select -ExpandProperty Count}},&lt;/P&gt;
&lt;P&gt;@{N="Not Applicable Patches";E={$_.NotApplicablePatches | Measure-Object | Select -ExpandProperty Count}},&lt;/P&gt;
&lt;P&gt;Status |&lt;/P&gt;
&lt;P&gt;Export-Csv "c:\compliance.csv" -UseCulture&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P&gt;The problem with the text file is most probably caused by the .ps1xml file that controls the formatting of these properties (but that is another story).&lt;/P&gt;&lt;P&gt;So add the Format-Table again.&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;Get-Compliance -Entity $inventoryItem -Detailed |&lt;/P&gt;
&lt;P&gt;Format-Table -AutoSize |&lt;/P&gt;
&lt;P&gt;Out-File&amp;nbsp; -Width 255 -FilePath "c:\compliance.txt"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 19:48:44 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413713#M59</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-07-24T19:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413714#M60</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both worked out great LucD. Thank you again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 20:24:50 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413714#M60</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-24T20:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413715#M61</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have another question on how to run the script. Right now I'm doing the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set my hosts in C:\esxihosts.txt:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13747621198502093" jivemacro_uid="_13747621198502093"&gt;&lt;SPAN style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;$vmHosts = Get-Content "C:\esxihosts.txt"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;Then I'll run the script with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13747621266939618" jivemacro_uid="_13747621266939618"&gt;&lt;SPAN style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;ExportCompliance.ps1 (Get-VMHost -Name $vmHosts) "C:\Reports\"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;Everything runs perfect like this. I was hoping to set these up as scheduled reports, and was wondering how I could set the variables within the script itself. For instance, I could have one script setup with the $vmHosts variable to point to esxihosts1.txt, and another script to point to esxihosts2.txt.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:24:16 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413715#M61</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-25T14:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413716#M62</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added the following:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1374766961863410" jivemacro_uid="_1374766961863410"&gt;
&lt;P&gt;$vmhostfile = Get-Content "C:\esxihosts.txt"&lt;/P&gt;
&lt;P&gt;$vmesxi = (Get-VMHost -Name $vmhostfile)&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 15:42:43 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413716#M62</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-25T15:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413717#M63</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can even make that shorter :smileygrin:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;$vmesxi = (Get-VMHost -Name (Get-Content "C:\esxihosts.txt")) &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 16:22:53 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413717#M63</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2013-07-25T16:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Export Compliance Reports</title>
      <link>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413718#M64</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing I noticed is that the script does not seem to loop anymore. If I have 2 hostnames in the text file, the output only displays 1 of them. Why would that happen?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 18:07:37 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Update-Manager-PowerCLI/Export-Compliance-Reports/m-p/413718#M64</guid>
      <dc:creator>elihuj</dc:creator>
      <dc:date>2013-07-25T18:07:37Z</dc:date>
    </item>
  </channel>
</rss>

