From a82e46040658b937996752a97123d89d33e2254e Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Thu, 30 Jul 2020 12:23:38 +0200 Subject: [PATCH] Update --- Examples/Example-29-FindGPO1.ps1 | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Examples/Example-29-FindGPO1.ps1 b/Examples/Example-29-FindGPO1.ps1 index 8851898..2d2c5a8 100644 --- a/Examples/Example-29-FindGPO1.ps1 +++ b/Examples/Example-29-FindGPO1.ps1 @@ -1,20 +1,18 @@ Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force -$Output = Invoke-GPOZaurr #-NoTranslation +$Output = Invoke-GPOZaurr $Output | Format-Table +# Report to Excel of translated reports +foreach ($Key in $Output.Reports.Keys) { + $Output.Reports[$Key] | ConvertTo-Excel -FilePath $Env:USERPROFILE\Desktop\GPOAnalysis.xlsx -ExcelWorkSheetName $Key -AutoFilter -AutoFit -FreezeTopRowFirstColumn +} + +# Report to HTML of translated reports New-HTML { - foreach ($GPOCategory in $Output.Keys) { - New-HTMLTab -Name $GPOCategory { - if ($Output["$GPOCategory"] -is [System.Collections.IDictionary]) { - foreach ($GpoSettings in $Output["$GPOCategory"].Keys) { - New-HTMLTab -Name $GpoSettings { - New-HTMLTable -DataTable $Output[$GPOCategory][$GpoSettings] -ScrollX -DisablePaging -AllProperties -Title $GpoSettings - } - } - } else { - New-HTMLTable -DataTable $Output[$GPOCategory] -ScrollX -DisablePaging -AllProperties -Title $GpoSettings - } + foreach ($Key in $Output.Reports.Keys) { + New-HTMLTab -Name $Key { + New-HTMLTable -DataTable $Output.Reports[$Key] -Filtering } } -} -Online -ShowHTML -FilePath $Env:UserProfile\Desktop\OutputFromFindGPO.html \ No newline at end of file +} -FilePath $Env:USERPROFILE\Desktop\GPOAnalysis.html -ShowHTML -Online \ No newline at end of file