Only import selenium if existent
This commit is contained in:
parent
f3b964fd87
commit
4a42abdbe4
1 changed files with 10 additions and 8 deletions
|
@ -2,14 +2,16 @@
|
||||||
. "$PSScriptRoot/Context.ps1";
|
. "$PSScriptRoot/Context.ps1";
|
||||||
|
|
||||||
if (-not ("OpenQA.Selenium.Firefox.FirefoxDriver" -as [type])) {
|
if (-not ("OpenQA.Selenium.Firefox.FirefoxDriver" -as [type])) {
|
||||||
$zipFile = [System.IO.Compression.ZipFile]::OpenRead((Get-Package Selenium.WebDriver).Source);
|
if ((Get-Package Selenium.WebDriver -ErrorAction "SilentlyContinue")) {
|
||||||
$stream = [System.IO.MemoryStream]::new();
|
$zipFile = [System.IO.Compression.ZipFile]::OpenRead((Get-Package Selenium.WebDriver).Source);
|
||||||
$reader = [System.IO.StreamReader]($zipFile.Entries[2]).Open();
|
$stream = [System.IO.MemoryStream]::new();
|
||||||
$reader.BaseStream.CopyTo($stream);
|
$reader = [System.IO.StreamReader]($zipFile.Entries[2]).Open();
|
||||||
[byte[]]$bytes = $stream.ToArray();
|
$reader.BaseStream.CopyTo($stream);
|
||||||
$reader.Close();
|
[byte[]]$bytes = $stream.ToArray();
|
||||||
$zipFile.Dispose();
|
$reader.Close();
|
||||||
[System.Reflection.Assembly]::Load($bytes);
|
$zipFile.Dispose();
|
||||||
|
[System.Reflection.Assembly]::Load($bytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Start-CustomDownload() {
|
function Start-CustomDownload() {
|
||||||
|
|
Loading…
Reference in a new issue