poshbotio / PoshBot

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

Force module import to pick up changes #118

Closed Tadas closed 5 years ago

Tadas commented 5 years ago

Should use -Force when importing plugin modules

Description

When using PoshBot in an interactive shell, the module remains loaded in the session even if a bot instance is stopped and later started. Plugin modules are imported into PoshBot's scope.

This means that after a plugin module has been imported once, subsequent calls to Import-Module will not do anything. If new plugin functions have been added PoshBot will not know about them after stopping and starting the instance.

Using -Force ensures that modules are always (re)loaded from disk.

Related Issue

https://github.com/poshbotio/PoshBot/issues/117

Motivation and Context

How Has This Been Tested?

Types of changes

Checklist:

devblackops commented 5 years ago

Thanks @Tadas!

Tadas commented 5 years ago

Most welcome 👍