forked from mithrandyr/SimplySql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.ps1
44 lines (36 loc) · 1.57 KB
/
Test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[cmdletBinding()]
Param([switch]$Load, [switch]$NoTest, [string]$TestName)
If($Load) {
Write-Host "Original PID: $pid"
If($NoTest) { $cmd = "{0} -NoTest" -f $PSCmdlet.MyInvocation.MyCommand.Source }
Else {
If($TestName) { $cmd = "{0} -TestName '{1}'" -f $PSCmdlet.MyInvocation.MyCommand.Source, $TestName }
Else { $cmd = "{0}" -f $PSCmdlet.MyInvocation.MyCommand.Source }
}
PowerShell -noprofile -noexit -command $cmd
if($global:IsNestedSessionSimplySql) { Write-Warning "Exited one session, but currently in another nested session!" }
else { Write-Warning "You have exited the last nested session."}
}
Else {
Write-Host "Session PID: $pid"
#Clear-Host
Write-Host "In New PowerShell Session, [exit] to resume."
$global:IsNestedSessionSimplySql = $true
$PSModuleAutoLoadingPreference = "none"
Import-Module $PSScriptRoot\SimplySql -Force
Get-Module SimplySql | Where-Object Path -NotLike "$PSScriptRoot\*" | Remove-Module
Import-Module Pester -Force
Write-Host ("Loaded '{0}' of SimplySql!" -f (Get-Module SimplySql).Version.ToString())
If(-not $NoTest) {
If($TestName) { Invoke-Pester -Script $PSScriptRoot -FullNameFilter $TestName -Show All}
Else { Invoke-Pester -Script $PSScriptRoot -Show All }
}
<#Get-Module SimplySql | Format-List
Get-SqlProviderHelp -Provider SQL
Get-SqlProviderHelp -Provider SQLite
Open-SqlConnection -DataSource it4 -InitialCatalog sandbox
Show-SqlConnection
isq "select @a" -Parameters @{a=1}
Get-SqlProviderHelp -Provider SQL
#>
}