Skip to content

Commit 7e0eb02

Browse files
committed
Changed connection test to sqlonly and non pooled. Removed message to user
1 parent 1358c04 commit 7e0eb02

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

internal/functions/Test-PSDCConfiguration.ps1

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
Write-PSFMessage -Message "Attempting to connect to PSDatabaseClone database server $SqlInstance.." -Level Verbose
8989
try {
90-
$pdcServer = Connect-DbaInstance -SqlInstance $SqlInstance -SqlCredential $SqlCredential
90+
$pdcServer = Connect-DbaInstance -SqlInstance $SqlInstance -SqlCredential $SqlCredential -SqlConnectionOnly -NonPooledConnection
9191
}
9292
catch {
9393
Stop-PSFFunction -Message "Could not connect to Sql Server instance $SqlInstance" -ErrorRecord $_ -Target $pdcServer -Continue
@@ -98,20 +98,6 @@
9898
Stop-PSFFunction -Message "PSDatabaseClone database $Database is not present on $SqlInstance" -Target $pdcServer -Continue
9999
}
100100

101-
# Check if the Hyper-V feature is enabled
102-
if ($osDetails.Caption -like '*Windows 10*') {
103-
$feature = Get-WindowsOptionalFeature -FeatureName 'Microsoft-Hyper-V-All' -Online
104-
if ($feature.State -ne "Enabled") {
105-
Write-PSFMessage -Message "Hyper-V is not enabled, the module can only be used remotely.`nTo use the module locally execute the following command: `"Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All`"" -Level Warning -FunctionName 'Test-PSDCConfiguration'
106-
}
107-
}
108-
elseif ($osDetails.Caption -like '*Windows Server*') {
109-
$feature = Get-WindowsFeature -Name 'Hyper-V'
110-
if (-not $feature.Installed) {
111-
Write-PSFMessage -Message "Hyper-V is not enabled, the module can only be used remotely.`nTo use the module locally execute the following command: `"Install-WindowsFeature -Name Hyper-V`"" -Level Warning -FunctionName 'Test-PSDCConfiguration'
112-
}
113-
}
114-
115101
Write-PSFMessage -Message "Finished checking configurations" -Level Verbose
116102

117103
}

0 commit comments

Comments
 (0)