Skip to content

Commit d90b0ec

Browse files
committed
fix
1 parent 9fbdcbe commit d90b0ec

4 files changed

Lines changed: 12 additions & 20 deletions

File tree

fscps.lcs/bin/fscps.lcs.dll

0 Bytes
Binary file not shown.

fscps.lcs/bin/fscps.lcs.pdb

0 Bytes
Binary file not shown.

fscps.lcs/fscps.lcs.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'fscps.lcs.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.0.14'
15+
ModuleVersion = '1.0.16'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

fscps.lcs/fscps.lcs.psm1

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
$script:ModuleRoot = "$PSScriptRoot"
22
$script:ModuleVersion = (Import-PowerShellDataFile -Path "$($script:ModuleRoot)\fscps.lcs.psd1").ModuleVersion
33
$Script:DefaultTempPath = "c:\temp\fscps.lcs"
4-
$Script:BinFolder = "$($Script:ModuleRoot)\bin"
5-
$Script:PlaywrightDll = "$($Script:BinFolder)\Microsoft.Playwright.dll"
6-
$Script:CookiesPath = "$Script:BinFolder\.playwright\state.json"
7-
84
# Detect whether at some level dotsourcing was enforced
95
$script:doDotSource = Get-PSFConfigValue -FullName fscps.lcs.Import.DoDotSource -Fallback $false
106
if ($fscps.lcs_dotsourcemodule) { $script:doDotSource = $true }
@@ -88,19 +84,10 @@ else
8884
. Import-ModuleFile -Path "$($script:ModuleRoot)\resourcesAfter.ps1"
8985
}
9086
}
87+
$Script:BinFolder = "$($Script:ModuleRoot)\bin"
88+
$Script:PlaywrightDll = "$($Script:BinFolder)\Microsoft.Playwright.dll"
89+
$Script:CookiesPath = "$Script:BinFolder\.playwright\state.json"
9190

92-
function Ensure-PlaywrightBrowsers {
93-
# Check for the .playwright folder or a marker file to avoid redundant installs
94-
$browsersMarker = Join-Path $Script:BinFolder ".playwright"
95-
if (-not (Test-Path $browsersMarker)) {
96-
Write-Verbose "Installing Playwright browsers..."
97-
$Env:PLAYWRIGHT_DRIVER_SEARCH_PATH = "$Script:BinFolder"
98-
$arguments = @("install", "--with-deps")
99-
[Microsoft.Playwright.Program]::Main($arguments)
100-
} else {
101-
Write-Verbose "Playwright browsers already installed."
102-
}
103-
}
10491
#region Playwright
10592
$tempFolder = [System.IO.Path]::Combine($Script:DefaultTempPath, "Microsoft.Playwright")
10693
[System.IO.Directory]::CreateDirectory($Script:tempFolder) | Out-Null
@@ -120,11 +107,16 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem
120107

121108
Get-ChildItem $tempFolder -Recurse | Where-Object { $_.Name -eq "Microsoft.Playwright.dll" } | ForEach-Object {
122109
$dllPath = $_.FullName
123-
Copy-Item -Path $dllPath -Destination "$($script:PlaywrightDll)" -Force
110+
Copy-Item -Path $dllPath -Destination "$($script:PlaywrightDll)" -Force
124111
[Reflection.Assembly]::Load([System.IO.File]::ReadAllBytes("$($script:PlaywrightDll)")) | Out-Null
125112
}
126-
# Ensure Playwright browsers are installed
127-
Ensure-PlaywrightBrowsers
113+
# Load the Playwright library
114+
$Env:PLAYWRIGHT_DRIVER_SEARCH_PATH = "$script:BinFolder"
115+
$arguments = @(
116+
"install",
117+
"--with-deps"
118+
)
119+
[Microsoft.Playwright.Program]::Main($arguments)
128120
#endregion Playwright
129121

130122
#endregion Load individual files

0 commit comments

Comments
 (0)