AutomatedLab / AutomatedLab.Common

PowerShell module for daily administrative tasks and general helper functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to add AutomatedLab.Common.dll

raandree opened this issue · comments

Importing the module does not work. Due to the missing types, deployments are failing when accessing the type [GPO.Helper].

PS C:\> ipmo AutomatedLab.Common
WARNING: Unable to add AutomatedLab.Common.dll - GPO and PKI functionality might be impaired.
Exception was: Cannot bind parameter 'Path' to the target. Exception setting "Path": "Cannot find path 'C:\Program Files\WindowsPowerShell\Modules\AutomatedLab.Common\2.0.129\lib\full\AutomatedLab.Common.dll' becaus
e it does not exist.", 

Just realized this only occurs if the module is installed along with the MSI. After downloading it from the gallery, things work as expected.

Unfortunately, only the warning has gone but types are missing:

Unable to find type [GPO.Helper].
At C:\Program Files\WindowsPowerShell\Modules\AutomatedLab\5.9.39\AutomatedLab.psm1:137 char:9
+         [GPO.Helper]::SetGroupPolicy($true, 'SOFTWARE\Policies\Micros ...
+         ~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (GPO.Helper:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Cannot reproduce. Windows PowerShell: 5.1.18362.1, PowerShell Core: 6.2.0

Both work fine:

Import-Module AutomatedLab.Common
[GPO.Helper]

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     False    Helper                                   System.Object

Fixed personally ;)