Skip to content

Commit 12e8e68

Browse files
committed
Stop open driver on Module unload
1 parent 4c72c84 commit 12e8e68

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Internal/init.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
using namespace System.Collections.Generic
22

3+
4+
if (!$PSCommandPath.EndsWith('init.ps1')) {
5+
$MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
6+
Get-SeDriver | Stop-SeDriver
7+
}
8+
9+
}
10+
11+
312
Function New-Condition {
413
Param([Parameter(Mandatory = $true)]$Text, [Type]$ValueType, $Tooltip, [Switch]$OptionalValue, $ElementRequired = $true )
514
return [PSCustomObject]@{

Output/Selenium/Selenium.psm1

350 Bytes
Binary file not shown.

Selenium.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ ForEach ($folder in $functionFolders) {
1313
}
1414
}
1515
}
16+
17+
$MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
18+
Get-SeDriver | Stop-SeDriver
19+
}
20+
1621
$publicFunctions = (Get-ChildItem -Path "$PSScriptRoot\Public" -Filter '*.ps1').BaseName
1722
Export-ModuleMember -Function $publicFunctions

0 commit comments

Comments
 (0)