Skip to content

Commit 09fa5d7

Browse files
committed
Ensuring that all modules are loaded
1 parent 570d072 commit 09fa5d7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bin/deploy.ps1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ Param (
3131
[string]$Type = 'SQLServer'
3232
)
3333

34-
#Import module
35-
If (-not (Get-Module dbops)) {
36-
Import-Module "$PSScriptRoot\Modules\dbops\dbops.psd1"
34+
#Import modules
35+
foreach ($module in @('PSFramework', 'dbops')) {
36+
if (-not (Get-Module $module)) {
37+
Import-Module "$PSScriptRoot\Modules\$module"
38+
}
3739
}
38-
. "$PSScriptRoot\Modules\dbops\internal\classes\DBOps.enums.ps1"
3940

4041
$config = Get-DBOConfig -Path "$PSScriptRoot\dbops.config.json" -Configuration $Configuration
4142

@@ -62,7 +63,8 @@ foreach ($key in ($PSBoundParameters.Keys)) {
6263

6364
if ($PSCmdlet.ShouldProcess($params.PackageFile, "Initiating the deployment of the package")) {
6465
Invoke-DBODeployment @params
65-
} else {
66+
}
67+
else {
6668
Invoke-DBODeployment @params -WhatIf
6769
}
6870

0 commit comments

Comments
 (0)