Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/donwload more modules at the same time #28

Open
paddy75 opened this issue Oct 10, 2021 · 3 comments
Open

Update/donwload more modules at the same time #28

paddy75 opened this issue Oct 10, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@paddy75
Copy link

paddy75 commented Oct 10, 2021

Helllo,

I'm using this code to download two modules:
Initialize-ModulePortable -Name 'ADEssentials' -Download -Path "$ScriptDirectory\Modules" Initialize-ModulePortable -Name 'PSWriteHTML' -Download -Path "$ScriptDirectory\Modules"
in the folder I get back this result
folder
:
If i look inside the ADEssentials.ps1 I see that there are all modules added.
PSWriteHTML.psd1
PSEventViewer.pds1
ADEssentials.psd1

Why the PSWriteHTML.psd1 is also added?
When I change the download order, this has no effect. Every time it is addes to the ADEssentials.psd1 file.
Correct me if I'm wrong, but normaly in this file only the module should be addes for the provides module??

Thanks.

@PrzemyslawKlys
Copy link
Member

Hi,

If you do Install-Module ADEssentials -Force -Verbose you will see that what will actually happen is it first checks if PSEventViewer and PSWriteHTML exists and then it downloads them, and then finally it downloads ADEssentials.

This is because ADEssentials has required modules defined PSWriteHTML/PSEventViewer to work.

image

SO if you request Initialize-ModulePortable - it checks PSD1 and finds required modules and downloads them and builds a PS1 files to execute. If you then request just PSWriteHTML it's gonna just do the same thing again - but this time it's gonna need PSWriteHTML only.

I still would recommend using Save-Module to save files somewhere and just copy them to modules as it will be more straightforward.

PSWriteHTML is bundled in ADEssentials because it delivers 4-5 cmdlets that display HTML such as Show-WinADGroupMember and few others.

@paddy75
Copy link
Author

paddy75 commented Oct 10, 2021

Hi,
thanks to clarify, now it makes sense.
After the first run all is downloaded and looks nice now. If i run it a second time (for later updates) I only get a message
"Initialze-ModulePortable - Modules to load not found in --Path to directory-- \modules"

@PrzemyslawKlys
Copy link
Member

I've never played wiht it the second time. It probably needs updates to code to support updates

@PrzemyslawKlys PrzemyslawKlys added the enhancement New feature or request label Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants