From 642c4844a5d31287b26bc25bec30ce5ddb5dd699 Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Mon, 2 Dec 2024 22:53:34 +0100 Subject: [PATCH] Add default file path handling for HTML report generation, fixes #58 --- Public/Invoke-GPOZaurr.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Public/Invoke-GPOZaurr.ps1 b/Public/Invoke-GPOZaurr.ps1 index 4331889..812faea 100644 --- a/Public/Invoke-GPOZaurr.ps1 +++ b/Public/Invoke-GPOZaurr.ps1 @@ -126,6 +126,10 @@ } } + if (-not $FilePath) { + $FilePath = Get-FileName -Extension 'html' -Temporary -Name "GpoZaurr" + } + # Build data foreach ($T in $Script:GPOConfiguration.Keys) { if ($Script:GPOConfiguration[$T].Enabled -eq $true) { @@ -201,10 +205,6 @@ if (-not $SplitReports) { # Generate pretty HTML $TimeLogHTML = Start-TimeLog - if (-not $FilePath) { - $FilePath = Get-FileName -Extension 'html' -Temporary - } - New-HTMLReportAll -FilePath $FilePath -Online:$Online -HideHTML:$HideHTML -Type $Type $TimeLogEndHTML = Stop-TimeLog -Time $TimeLogHTML -Option OneLiner