Verification if Required Modules are in their required versions
voytas75 opened this issue · 7 comments
first use after module install:
Get-Logger : The term 'Get-Logger' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct a
nd try again.
At C:\Program Files\WindowsPowerShell\Modules\PSWinReportingV2\2.0.8\PSWinReportingV2.psm1:239 char:19
+ $Logger = Get-Logger @LoggerParameters
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-Logger:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
is module dependency missing?
There are multiple modules in play here. When you run:
Install-Module PSWinReportingV2 -Force
It should install any and all prerequisites. PSWinReporting is based on the following modules:
- PSEventViewer - mine
- PSSharedGoods (get-logger is there) - mine
- PSWriteHTML - mine for reports in HTML
- PSDiscord - if you want to send stuff to Discord - mine
- PSTeams - if you want to send messages to Teams - mine
- dbatools - if you want to send stuff to SQL, not mine
- PSSlack - not mine, if you want to send stuff to Slack
The ones checked are installed when you Install-Module.
correct. i did not use force switch.
I would like to see some info after importing the module, that maybe I do not have dependencies when I do not use the force switch.
Install-Module
alone should install any dependencies. If you already had some module before (like PSSharedGoods) in earlier version this is why it may have not been installed. Install-Module -Force
makes sure to installs newest versions regardless of what you have.
I need to explore .psd1 required modules more to have better use cases, but not sure there is sense to put a lot of effort.
i have to check it but if i recall i did not have this module.
btw nice work and thank you for fantastic functionality.
I checked. However, there is PSSharedGoods
in version 0.0.38
Ye, so you had very old version. Install-module found it, and skipped during installation. Get-Logger got added around 0.0.50 or so. Force installed new version.
I will have to add Required Version to required modules to prevent that in the future.
This will be rolled out with new version 2.0.10.