|
67 | 67 | Write-PSFMessage -Message "SqlInstance: $SqlInstance, Database: $Database" -Level Debug |
68 | 68 |
|
69 | 69 | # 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)) { |
71 | 71 | # Get the configurations for the program database |
72 | 72 | $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 |
74 | 75 | } |
75 | 76 |
|
76 | 77 | Write-PSFMessage -Message "Checking configurations" -Level Verbose |
|
101 | 102 | if ($osDetails.Caption -like '*Windows 10*') { |
102 | 103 | $feature = Get-WindowsOptionalFeature -FeatureName 'Microsoft-Hyper-V-All' -Online |
103 | 104 | 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' |
105 | 106 | } |
106 | 107 | } |
107 | 108 | elseif ($osDetails.Caption -like '*Windows Server*') { |
108 | 109 | $feature = Get-WindowsFeature -Name 'Hyper-V' |
109 | 110 | 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' |
111 | 112 | } |
112 | 113 | } |
113 | 114 |
|
|
0 commit comments