Closed mbl-35 closed 2 years ago
Trying ClassLoader module. Result: sub-modules have to be loaded on each module: this result on a unknown type on class inheritance !! Leave the class on source but not using it..
Stay using using module
to import custom modules, but use an initial wrapper to unload modules if loaded, then start main process (bootstrap.ps1).
With the last method, sometimes having this error:
Remove-Module : Aucun module n'a été supprimé. Vérifiez que la spécification des modules à supprimer est correcte et que ces modules existent dans l'instance d'exécution.
Au caractère D:\project-workspaces\github\wslctl\bin\wslctl.ps1:36 : 9
+ Remove-Module $_.Name -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Remove-Module], InvalidOperationException
+ FullyQualifiedErrorId : Modules_NoModulesRemoved,Microsoft.PowerShell.Commands.RemoveModuleCommand
part of code:
Get-Module | ForEach-Object {
if ($myModules.contains($_.Name)){
Write-Verbose "removing: $_.Name"
Remove-Module $_.Name -Force
}
}
To be investigate ...
Powershell load custom module in cache, which does not take account on module changes (e.g. version upgrade). Find a way to bypass this behavior