Skip to content

Commit f30a4fb

Browse files
committed
Added credential config value. Changed warning message.
1 parent 506bac7 commit f30a4fb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

internal/functions/Test-PSDCConfiguration.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@
6767
Write-PSFMessage -Message "SqlInstance: $SqlInstance, Database: $Database" -Level Debug
6868

6969
# Check if the values for the PSDatabaseClone database are set
70-
if (($null -eq $SqlInstance) -or ($null -eq $Database)) {
70+
if (($null -eq $SqlInstance) -or ($null -eq $Database) -or ($null -eq $SqlCredential)) {
7171
# Get the configurations for the program database
7272
$Database = Get-PSFConfigValue -FullName psdatabaseclone.database.name -Fallback "NotConfigured"
73-
$SqlInstance = Get-PSFConfigValue -FullName psdatabaseclone.database.Server -Fallback "NotConfigured"
73+
$SqlInstance = Get-PSFConfigValue -FullName psdatabaseclone.database.server -Fallback "NotConfigured"
74+
$SqlCredential = Get-PSFConfigValue -FullName psdatabaseclone.database.credential -Fallback $null
7475
}
7576

7677
Write-PSFMessage -Message "Checking configurations" -Level Verbose
@@ -101,13 +102,13 @@
101102
if ($osDetails.Caption -like '*Windows 10*') {
102103
$feature = Get-WindowsOptionalFeature -FeatureName 'Microsoft-Hyper-V-All' -Online
103104
if ($feature.State -ne "Enabled") {
104-
Write-PSFMessage -Message 'Please enable the Hyper-V feature with "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All"' -Level Warning -FunctionName 'Pre Import'
105+
Write-PSFMessage -Message 'Hyper-V is not enabled, the module can only be used remotely.`n To use the module locally execute the following command: "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All"' -Level Warning -FunctionName 'Pre Import'
105106
}
106107
}
107108
elseif ($osDetails.Caption -like '*Windows Server*') {
108109
$feature = Get-WindowsFeature -Name 'Hyper-V'
109110
if (-not $feature.Installed) {
110-
Write-PSFMessage -Message 'Please enable the Hyper-V feature with "Install-WindowsFeature -Name Hyper-V"' -Level Warning -FunctionName 'Pre Import'
111+
Write-PSFMessage -Message 'Hyper-V is not enabled, the module can only be used remotely.`n To use the module locally execute the following command: "Install-WindowsFeature -Name Hyper-V"' -Level Warning -FunctionName 'Pre Import'
111112
}
112113
}
113114

0 commit comments

Comments
 (0)