Skip to content

Commit bd47e7b

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

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

functions/Get-PSDCImage.ps1

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,24 @@
7070
)
7171

7272
begin {
73+
# Get the module configurations
74+
$pdcSqlInstance = Get-PSFConfigValue -FullName psdatabaseclone.database.Server
75+
$pdcDatabase = Get-PSFConfigValue -FullName psdatabaseclone.database.name
76+
if (-not $pdcCredential) {
77+
$pdcCredential = Get-PSFConfigValue -FullName psdatabaseclone.database.credential -Fallback $null
78+
}
79+
else {
80+
$pdcCredential = $PSDCSqlCredential
81+
}
82+
7383
# Test the module database setup
7484
try {
75-
Test-PSDCConfiguration -SqlCredential $PSDCSqlCredential -EnableException
85+
Test-PSDCConfiguration -SqlCredential $pdcCredential -EnableException
7686
}
7787
catch {
7888
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
7989
}
8090

81-
$pdcSqlInstance = Get-PSFConfigValue -FullName psdatabaseclone.database.server
82-
$pdcDatabase = Get-PSFConfigValue -FullName psdatabaseclone.database.name
83-
8491
$query = "
8592
SELECT ImageID,
8693
ImageName,

0 commit comments

Comments
 (0)