EvotecIT / PSWinReporting

This PowerShell Module has multiple functionalities, but one of the signature features of this module is the ability to parse Security logs on Domain Controllers providing easy to use access to AD Events.
MIT License
705 stars 70 forks source link

Verification if Required Modules are in their required versions #48

Closed voytas75 closed 5 years ago

voytas75 commented 5 years ago

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?

PrzemyslawKlys commented 5 years ago

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:

The ones checked are installed when you Install-Module.

voytas75 commented 5 years ago

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.

PrzemyslawKlys commented 5 years ago

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.

voytas75 commented 5 years ago

i have to check it but if i recall i did not have this module. btw nice work and thank you for fantastic functionality.

voytas75 commented 5 years ago

I checked. However, there is PSSharedGoods in version 0.0.38

PrzemyslawKlys commented 5 years ago

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.

PrzemyslawKlys commented 5 years ago

This will be rolled out with new version 2.0.10.