Skip to content

Commit

Permalink
Merge pull request #32 from swissbuechi/fix-dependency-module-import
Browse files Browse the repository at this point in the history
Added import-module to dependency check
  • Loading branch information
swissbuechi authored Aug 5, 2023
2 parents 553d215 + be71ed3 commit dbff955
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion AzureAdDeployer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
RootModule = 'AzureAdDeployer.psm1'

# Version number of this module.
ModuleVersion = '2.16.5'
ModuleVersion = '2.16.6'

# Supported PSEditions
CompatiblePSEditions = @("Core")
Expand Down
4 changes: 4 additions & 0 deletions public/Helper/Invoke-DependencyCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ Function Get-AllModulesInstalled {
if ($Install) {
Write-Host "Module $($Dependency.ModuleName) with version $($Dependency.ModuleVersion) is not installed. Installing it now." -ForegroundColor Yellow
Install-Module -Name $Dependency.ModuleName -RequiredVersion $Dependency.ModuleVersion -Force
Import-Module -Name $Dependency.ModuleName -RequiredVersion $Dependency.ModuleVersion -Force
}
else {
Write-Host "Module $($Dependency.ModuleName) with version $($Dependency.ModuleVersion) is not installed. Please install it first." -ForegroundColor Red
$AllModulesInstalled = $false
}
}
else {
Import-Module -Name $Dependency.ModuleName -RequiredVersion $Dependency.ModuleVersion -Force
}
}
if (-not ($AllModulesInstalled)) {
Write-Host "Install dependencies: aaddepl -InstallDependencies"
Expand Down

0 comments on commit dbff955

Please sign in to comment.