From 36b3e7a21b564a914253461e601f2bdece201562 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 May 2026 09:39:13 +0000 Subject: [PATCH 1/2] Initial plan From 6f85eec38cc5e4be63e1b4c99ce8faeec6388407 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 May 2026 10:41:38 +0000 Subject: [PATCH 2/2] Apply PR 722 changes: PSParseHTML guard, module-path-first DLL lookup, HOME fallback, remove duplicate fetch/parse Agent-Logs-Url: https://github.com/DevClate/EntraFIDOFinder/sessions/edc726c2-01bc-4607-adee-744f64a0c60f Co-authored-by: DevClate <107187714+DevClate@users.noreply.github.com> --- Scripts/Export-GHEntraFido.ps1 | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/Scripts/Export-GHEntraFido.ps1 b/Scripts/Export-GHEntraFido.ps1 index 73282ed..2389598 100644 --- a/Scripts/Export-GHEntraFido.ps1 +++ b/Scripts/Export-GHEntraFido.ps1 @@ -23,22 +23,30 @@ Function Export-GHEntraFido { [string]$Url ) + if (-not (Get-Module -Name PSParseHTML)) { + Import-Module PSParseHTML -ErrorAction Stop + } + if (-not ('HtmlAgilityPack.HtmlDocument' -as [type])) { - $dll = Get-ChildItem -Path $HOME -Recurse -Filter HtmlAgilityPack.dll -ErrorAction SilentlyContinue | - Select-Object -First 1 + $module = Get-Module PSParseHTML + $dll = $null - if (-not $dll) { - throw "HtmlAgilityPack.dll not found. Ensure the dependency is installed before running Export-GHEntraFido." - } + if ($module -and $module.ModuleBase) { + $dll = Get-ChildItem -Path $module.ModuleBase -Recurse -Filter HtmlAgilityPack.dll -ErrorAction SilentlyContinue | + Select-Object -First 1 + } - Add-Type -Path $dll.FullName -} + if (-not $dll) { + $dll = Get-ChildItem -Path $HOME -Recurse -Filter HtmlAgilityPack.dll -ErrorAction SilentlyContinue | + Select-Object -First 1 + } - $response = Invoke-WebRequest -Uri $Url -UseBasicParsing - $htmlContent = $response.Content + if (-not $dll) { + throw "HtmlAgilityPack.dll not found. Ensure the dependency is installed before running Export-GHEntraFido." + } - $htmlDocument = New-Object HtmlAgilityPack.HtmlDocument - $htmlDocument.LoadHtml($htmlContent) + Add-Type -Path $dll.FullName + } # Fetch the webpage content $response = Invoke-WebRequest -Uri $Url -UseBasicParsing