diff --git a/.github/workflows/GHMerge.yml b/.github/workflows/GHMerge.yml index e3d4e1e..8e2a3ca 100644 --- a/.github/workflows/GHMerge.yml +++ b/.github/workflows/GHMerge.yml @@ -24,7 +24,10 @@ jobs: - name: Install PSParseHTML Module shell: pwsh - run: Install-Module -Name PSParseHTML -Force -Scope CurrentUser + run: | + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module -Name PSParseHTML -Force -Scope CurrentUser + Import-Module PSParseHTML -Force - name: Run Merge-GHFidoData Script id: merge_script diff --git a/Scripts/Export-GHEntraFido.ps1 b/Scripts/Export-GHEntraFido.ps1 index 73282ed..4d91895 100644 --- a/Scripts/Export-GHEntraFido.ps1 +++ b/Scripts/Export-GHEntraFido.ps1 @@ -23,23 +23,10 @@ Function Export-GHEntraFido { [string]$Url ) - if (-not ('HtmlAgilityPack.HtmlDocument' -as [type])) { - $dll = Get-ChildItem -Path $HOME -Recurse -Filter HtmlAgilityPack.dll -ErrorAction SilentlyContinue | - Select-Object -First 1 - - if (-not $dll) { - throw "HtmlAgilityPack.dll not found. Ensure the dependency is installed before running Export-GHEntraFido." + if (-not (Get-Module -Name PSParseHTML)) { + Import-Module PSParseHTML -ErrorAction Stop } - Add-Type -Path $dll.FullName -} - - $response = Invoke-WebRequest -Uri $Url -UseBasicParsing - $htmlContent = $response.Content - - $htmlDocument = New-Object HtmlAgilityPack.HtmlDocument - $htmlDocument.LoadHtml($htmlContent) - # Fetch the webpage content $response = Invoke-WebRequest -Uri $Url -UseBasicParsing $htmlContent = $response.Content