


Still, it doesn't make Remove-Module work 100%. Many modules can get imported without installation.


+ FullyQualifiedErrorId : ModuleIsInUse,Uninstall-Package.Uninstallĭoes anybody have any idea to resolve this?Īs mentioned in the original answer by E Bekker, modules may get stuck in session.Ĭlosing the PowerShell session, and running uninstall in a new one should help. + CategoryInfo : InvalidOperation: (:UninstallPackage) [Uninstall-Packag PackageManagement\Uninstall-Package : Module 'XXXX' is in currently in use.Īt C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2046 char:21 WARNING: The version '#' of module 'XXXX' is currently in use. Uninstall-Module -Name "XXXX" -AllVersions -forceīut this uninstall module command gives following error. Now once we used the functionality of this module, we uninstall it at the end of deployment script using following command. Install-Module -Name "XXXX" -AllowClobber -RequiredVersion "XXXX" -Repository "XXXX" -Scope AllUsers XXXX) into "C:\Program Files\WindowsPowerShell\Modules". Using following command we are installing module (i.e. We are using some PowerShell modules in one deployment PowerShell script.
