poshbotio / PoshBot

Powershell-based bot framework
MIT License
536 stars 108 forks source link

Update to 0.11.8 Results In Custom Types Not Being Found #176

Closed sheldonhull closed 4 years ago

sheldonhull commented 4 years ago

Expected Behavior

Updated to PoshBot 0.11.8 Start the bot script and it tells me that it can't find some of the types that have been declared and working fine before.

Current Behavior

At C:\Program Files\WindowsPowerShell\Modules\PoshBot\0.11.8\PoshBot.psm1:2668 char:6
+     [PoshBot.FromConfig]$Metadata
+      ~~~~~~~~~~~~~~~~~~
Unable to find type [PoshBot.FromConfig].
At C:\Program Files\WindowsPowerShell\Modules\PoshBot\0.11.8\PoshBot.psm1:2671 char:30
+     ConfigProvidedParameter([PoshBot.FromConfig]$Meta, [System.Manage ...
+                              ~~~~~~~~~~~~~~~~~~
Unable to find type [PoshBot.FromConfig].
At C:\Program Files\WindowsPowerShell\Modules\PoshBot\0.11.8\PoshBot.psm1:3315 char:6
+     [PoshBot.BotCommand]GetCommandMetadata([System.Management.Automat ...
+      ~~~~~~~~~~~~~~~~~~
Unable to find type [PoshBot.BotCommand].
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : TypeNotFound

Import-Module : The module to process 'PoshBot.psm1', listed in field 'ModuleToProcess/RootModule' of module manifest 'C:\Program
Files\WindowsPowerShell\Modules\PoshBot\0.11.8\PoshBot.psd1' was not processed because no valid module was found in any module
directory.
At C:\poshbot\bot.ps1:44 char:9
+         Import-Module @SplatModuleInfo -WarningAction SilentlyContinu ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (PoshBot:String) [Import-Module], PSInvalidOperationException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Your Environment

sheldonhull commented 4 years ago

Seems to be loading an older version despite my loading script ensuring the required version is set to 0.11.8. Deleted all the older versions from the folders manually....

Once I did this and reloaded, clearing also my generated programdata for the bot, it loaded successfully. Not sure why it would be loading an earlier version instead of the globally installed AllUsers version I ensured was available. It's a local admin too. Closing as resolved, but feel free to shine insight into this if you know why this would happen.