AWS 出现模块导入问题

问题描述 投票:0回答:1

我对 AWS PowerShell 模块感到“有趣”。

我必须在原来的模块上安装一个新的 AWS 模块,因为无法卸载原来的模块。

PS C:\Users\Administrator.MS-AA> UnInstall-Module -Name AWSPowerShell -Force
WARNING: The version '4.1.582' of module 'AWSPowerShell' is currently in use. Retry the operation after closing the applications.
PackageManagement\Uninstall-Package : Module 'AWSPowerShell' is in currently in use or you don't have the required permissions.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2194 char:21
+ ...        $null = PackageManagement\Uninstall-Package @PSBoundParameters
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power...ninstallPackage:UninstallPackage) [Uninstall-Package], Exception
    + FullyQualifiedErrorId : ModuleIsInUse,Uninstall-Package,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

安装新的 AWS 模块后,会出现以下一系列类似于以下内容的错误:

    "Error in TypeData "Amazon.EC2.Model.Region": The member Region is already present". 

因此,导入命令不起作用,并且所需的 SQS 命令失败,并显示以下内容:

     "Error receiving messages: The 'Receive-SQSMessage' command was found in the module 'AWSPowerShell', but the module could not be loaded. For more information, run 'Import-Module AWSPowerShell'.
        + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException"

还有,包裹清单很尴尬:

PS C:\Users\Administrator.MS-AA> Get-Package | findstr AWS
AWS Tools for Windows          3.15.1620                                         msi
AWS PV Drivers                 8.4.1                                             msi
AWSPowerShell                  4.1.582          https://www.powershellgallery... PowerShellGet

有什么想法吗?

致以诚挚的问候

amazon-web-services powershell
1个回答
0
投票

史密斯先生的建议奏效了!我已删除有问题的模块并可以继续。 谢谢史密斯先生! ;-)

© www.soinside.com 2019 - 2024. All rights reserved.