From caa958590656a706aaa0e4114dbbf2d3875ac6ec Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Sun, 2 Aug 2020 00:50:41 +0200 Subject: [PATCH] removed dead code --- Public/Invoke-GPOZaurr.ps1 | 98 -------------------------------------- 1 file changed, 98 deletions(-) diff --git a/Public/Invoke-GPOZaurr.ps1 b/Public/Invoke-GPOZaurr.ps1 index be687da..0fd3e96 100644 --- a/Public/Invoke-GPOZaurr.ps1 +++ b/Public/Invoke-GPOZaurr.ps1 @@ -211,104 +211,6 @@ Remove-EmptyValue -Hashtable $Output -Recursive } return $Output - <# - foreach ($GPO in $GPOs) { - if ($GPOPath) { - $GPOOutput = $GPO.GPOOutput - } else { - [xml] $GPOOutput = Get-GPOReport -Guid $GPO.GUID -Domain $GPO.DomainName -ReportType Xml - } - [Array] $Data = Get-XMLStandard -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects - foreach ($D in $Data) { - if (-not $Output["$($D.GpoCategory)"]) { - $Output["$($D.GpoCategory)"] = [ordered] @{} - } - if (-not $Output["$($D.GpoCategory)"]["$($D.GpoSettings)"]) { - $Output["$($D.GpoCategory)"]["$($D.GpoSettings)"] = [System.Collections.Generic.List[PSCustomObject]]::new() - } - $Output["$($D.GpoCategory)"]["$($D.GpoSettings)"].Add($D) - - if (-not $OutputByGPO["$($D.DomainName)"]) { - $OutputByGPO["$($D.DomainName)"] = [ordered] @{} - } - if (-not $OutputByGPO[$D.DomainName][$D.DisplayName]) { - $OutputByGPO[$D.DomainName][$D.DisplayName] = [System.Collections.Generic.List[PSCustomObject]]::new() - } - $OutputByGPO[$D.DomainName][$D.DisplayName].Add($D) - } - - } - if ($NoTranslation) { - if ($OutputType -contains 'Object') { - $Output - } - } else { - foreach ($Report in $Type) { - $Category = $Script:GPODitionary[$Report]['Category'] - $Settings = $Script:GPODitionary[$Report]['Settings'] - $TranslatedOutput[$Report] = Invoke-GPOTranslation -InputData $Output -Category $Category -Settings $Settings -Report $Report - } - if ($OutputType -contains 'Object') { - $TranslatedOutput - } - } - - if ($NoTranslation) { - $SingleSource = $Output - } else { - $SingleSource = $TranslatedOutput - } - - if ($OutputPath) { - $FolderPath = $OutputPath - } else { - $FolderPath = [io.path]::GetTempPath() - } - if ($OutputType -contains 'HTML') { - $FilePathHTML = [io.path]::Combine($FolderPath, "GPOZaurr-Summary-$((Get-Date).ToString('yyyy-MM-dd_HH_mm_ss')).html") - Write-Warning "Invoke-GPOZaurr - $FilePathHTML" - New-HTML { - foreach ($GPOCategory in $SingleSource.Keys) { - New-HTMLTab -Name $GPOCategory { - if ($SingleSource["$GPOCategory"] -is [System.Collections.IDictionary]) { - foreach ($GpoSettings in $SingleSource["$GPOCategory"].Keys) { - New-HTMLTab -Name $GpoSettings { - if ($SingleSource[$GPOCategory][$GpoSettings].Count -gt 0) { - New-HTMLTable -DataTable $SingleSource[$GPOCategory][$GpoSettings] -ScrollX -DisablePaging -AllProperties -Title $GpoSettings - } - } - } - } else { - if ($SingleSource[$GPOCategory].Count -gt 0) { - New-HTMLTable -DataTable $SingleSource[$GPOCategory] -ScrollX -DisablePaging -AllProperties -Title $GpoSettings - } - } - } - } - } -Online -ShowHTML:$Open.IsPresent -FilePath $FilePathHTML - } - if ($OutputType -contains 'Excel') { - $FilePathExcel = [io.path]::Combine($FolderPath, "GPOZaurr-Summary-$((Get-Date).ToString('yyyy-MM-dd_HH_mm_ss')).xlsx") - Write-Warning "Invoke-GPOZaurr - $FilePathExcel" - foreach ($GPOCategory in $SingleSource.Keys) { - if ($SingleSource["$GPOCategory"] -is [System.Collections.IDictionary]) { - foreach ($GpoSettings in $SingleSource["$GPOCategory"].Keys) { - if ($SingleSource[$GPOCategory][$GpoSettings].Count -gt 0) { - ConvertTo-Excel -DataTable $SingleSource[$GPOCategory][$GpoSettings] -AllProperties -ExcelWorkSheetName $GpoSettings -FilePath $FilePathExcel -AutoFilter -AutoFit -Option Rename - } - } - } else { - if ($SingleSource[$GPOCategory].Count -gt 0) { - ConvertTo-Excel -DataTable $SingleSource[$GPOCategory] -AllProperties -ExcelWorkSheetName $GPOCategory -FilePath $FilePathExcel -AutoFilter -AutoFit -Option Rename - } - } - } - if ($Open) { - Invoke-Item -Path $FilePathExcel - } - } - #> - } [scriptblock] $SourcesAutoCompleter = {