Skip to content

Commit 8b38cc6

Browse files
🪲 [Fix]: Fix removal of required and nested modules (#82)
## Description - Fix removal of required and nested modules ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 684d0b8 commit 8b38cc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/helpers/Build/Import-PSModule.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
Write-Verbose "Manifest file path: [$($manifestFile.FullName)]" -Verbose
3131
$existingModule = Get-Module -Name $ModuleName -ListAvailable
3232
$existingModule | Remove-Module -Force -Verbose
33-
$existingModule.RequiredModules | ForEach-Object { Remove-Module -Name $_ -Force -Verbose -ErrorAction SilentlyContinue }
34-
$existingModule.NestedModules | ForEach-Object { Remove-Module -Name $_ -Force -Verbose -ErrorAction SilentlyContinue }
33+
$existingModule.RequiredModules | ForEach-Object { $_ | Remove-Module -Force -Verbose -ErrorAction SilentlyContinue }
34+
$existingModule.NestedModules | ForEach-Object { $_ | Remove-Module -Force -Verbose -ErrorAction SilentlyContinue }
3535
# Get-InstalledPSResource | Where-Object Name -EQ $ModuleName | Uninstall-PSResource -SkipDependencyCheck -Verbose:$false
3636
Resolve-PSModuleDependencies -ManifestFilePath $manifestFile
3737
Import-Module -Name $ModuleName -RequiredVersion '999.0.0'

0 commit comments

Comments
 (0)