internal/Get-SmoServerForDynamicParams.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
Function Get-SmoServerForDynamicParams
{
    if ($fakeBoundParameter.length -eq 0) { return }
    
    $SqlInstance = $fakeBoundParameter['SqlInstance']
    $sqlcredential = $fakeBoundParameter['SqlCredential']
    
    if ($SqlInstance -eq $null)
    {
        $SqlInstance = $fakeBoundParameter['sqlinstance']
    }
    if ($SqlInstance -eq $null)
    {
        $SqlInstance = $fakeBoundParameter['source']
    }
    if ($sqlcredential -eq $null)
    {
        $sqlcredential = $fakeBoundParameter['Credential']
    }
    
    if ($SqlInstance)
    {
        Connect-SqlInstance -SqlInstance $SqlInstance -SqlCredential $SqlCredential -ParameterConnection
    }
}