Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 150956

Re: Export Compliance Reports

$
0
0

To get the numbers you will have to use the Measure-Object cmdlet.

Like this

Get-Compliance -Entity $inventoryItem -Detailed |

Select @{N="EntityName";E={$_.Entity.Name}},

@{N="Baseline";E={$_.Baseline.Name}},

@{N="Compliant Patches";E={$_.CompliantPatches | Measure-Object | Select -ExpandProperty Count}},

@{N="Not Compliant Patches";E={$_.NotCompliantPatches | Measure-Object | Select -ExpandProperty Count}},

@{N="Unknown Patches";E={$_.UnknownPatches | Measure-Object | Select -ExpandProperty Count}},

@{N="Not Applicable Patches";E={$_.NotApplicablePatches | Measure-Object | Select -ExpandProperty Count}},

Status |

Export-Csv "c:\compliance.csv" -UseCulture

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).

So add the Format-Table again.

Get-Compliance -Entity $inventoryItem -Detailed |

Format-Table -AutoSize |

Out-File  -Width 255 -FilePath "c:\compliance.txt"


Viewing all articles
Browse latest Browse all 150956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>