Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell Issue

$
0
0

I have the following script I am testing and cannot get it to format correctly.

When I run everything from the Sort lline up it works as it should with the grouping.

When I run the entire script the html file created looks terrible and no legible information as below.

Can anyone help.

$a = "<style>"
$a = $a + "BODY{background-color:peachpuff;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;}"
$a = $a + "</style>"



Get-ADComputer -Filter * -Properties * | 
select Name,OperatingSystem,OperatingSystemServicePack | 
Sort-Object Name | Format-Table Name,OperatingSystem -GroupBy OperatingSystem -AutoSize |
ConvertTo-Html |
out-file C:\scripts\test.html

THIS IS THE FILL RUN HTML SAMPLE

ClassId2e4f51ef21dd47e99d3c952918aff9cdpageHeaderEntrypageFooterEntryautosizeInfoshapeInfogroupingEntry
033ecb2bc07a4d43b5ef94ed5a35d280Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfoMicrosoft.PowerShell.Commands.Internal.Format.TableHeaderInfo
9e210fe47d09416682b841769c78b8a3Microsoft.PowerShell.Commands.Internal.Format.GroupingEntry
27c87ef9bbda4f709f6b4002fa4af63c
27c87ef9bbda4f709f6b4002fa4af63c
27c87ef9bbda4f709f6b4002fa4af63c
27c87ef9bbda4f709f6b4002fa4af63c
27c87ef9bbda4f709f6b4002fa4af63c
4ec4f0187cb04f4cb6973460dfe252df
9e210fe47d09416682b841769c78b8a3Microsoft.PowerShell.Commands.Internal.Format.GroupingEntry
27c87ef9bbda4f709f6b4002fa4af63c
4ec4f0187cb04f4cb6973460dfe252df
9e210fe47d09416682b841769c78b8a3Microsoft.PowerShell.Commands.Internal.Format.GroupingEntry
27c87ef9bbda4f709f6b4002fa4af63c
27c87ef9bbda4f709f6b4002fa4af63c


Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

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