Skip to content

Commit d6ab2e7

Browse files
committed
Changed the retrieveal of the configurations
1 parent 2ad4114 commit d6ab2e7

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

functions/Get-PSDCClone.ps1

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,24 @@
7575

7676
begin {
7777

78+
# Get the module configurations
79+
$pdcSqlInstance = Get-PSFConfigValue -FullName psdatabaseclone.database.Server
80+
$pdcDatabase = Get-PSFConfigValue -FullName psdatabaseclone.database.name
81+
if (-not $pdcCredential) {
82+
$pdcCredential = Get-PSFConfigValue -FullName psdatabaseclone.database.credential -Fallback $null
83+
}
84+
else {
85+
$pdcCredential = $PSDCSqlCredential
86+
}
87+
7888
# Test the module database setup
7989
try {
80-
Test-PSDCConfiguration -SqlCredential $PSDCSqlCredential -EnableException
90+
Test-PSDCConfiguration -SqlCredential $pdcCredential -EnableException
8191
}
8292
catch {
8393
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
8494
}
8595

86-
$pdcSqlInstance = Get-PSFConfigValue -FullName psdatabaseclone.database.server
87-
$pdcDatabase = Get-PSFConfigValue -FullName psdatabaseclone.database.name
88-
8996
$query = "
9097
SELECT c.CloneID,
9198
c.CloneLocation,

0 commit comments

Comments
 (0)