aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 77 forks source link

AWS.Tools Module Manifests are invalid #247

Closed floh96 closed 1 year ago

floh96 commented 2 years ago

Description

This is the same issue as #112. I'm trying to use the AWS.Tools.S3 Module. I installed the module following the docs. When i try to use the module it is not working:

PS C:\vagrant\scripts> Write-S3Object
Write-S3Object : The term 'Write-S3Object' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.

PS C:\vagrant\scripts> Import-Module AWS.Tools.S3
Import-Module : The specified module 'AWS.Tools.S3' was not loaded because no valid module file was found in any
module directory.

The Module Version I installed is 4.1.25.0 but when i check the powershell module folder the version folder is named 4.1.25

PS C:\vagrant\scripts> ls C:\Users\vagrant\Documents\WindowsPowerShell\Modules\AWS.Tools.S3\

    Directory: C:\Users\vagrant\Documents\WindowsPowerShell\Modules\AWS.Tools.S3

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2/17/2022  12:15 PM                4.1.25

Reproduction Steps

Install-Module -Name AWS.Tools.Installer Install-AWSToolsModule AWS.Tools.S3

Logs

Edit: Removed the logs since they where from a later installation which was successful.

Environment

Resolution


This is a :bug: bug-report

floh96 commented 2 years ago

I deleted and reinstalled the module multiple times and now it is working? Nevertheless someone should look into this issue since there are also multiple new reports in #112.

ashishdhingra commented 2 years ago

Hi @floh96,

Good morning.

Please confirm if you are using Windows PowerShell (not PowerShell Core). If yes, this is the known issue with Windows PowerShell, which is beyond the control of AWS.Tools.Installer. More details could be found here https://github.com/aws/aws-tools-for-powershell/issues/162#issuecomment-813658490. It self-resolves after several attempts.

Thanks, Ashish

floh96 commented 2 years ago

@ashishdhingra yes I'm using Windows PowerShell. what is the fix for windows powershell to install the module reliable? update the nuget provider before installation? reading the docs windows powershell is supported maybe mention this bug in the docs?

ashishdhingra commented 2 years ago

@ashishdhingra yes I'm using Windows PowerShell. what is the fix for windows powershell to install the module reliable? update the nuget provider before installation? reading the docs windows powershell is supported maybe mention this bug in the docs?

@floh96 The behavior is not in the control of AWS.Tools.Installer. May be specifying a note in documentation is a good idea as suggested by you.

pcgeek86 commented 2 years ago

I have a GitHub repository that uses GitHub Actions to automatically (daily) build a new container image, with the latest AWS PowerShell module in it. I suggest using this container image as a basis for your AWS automation scripts, to avoid version conflicts. You can pin to a specific version, using the appropriate version tag.

https://github.com/pcgeek86/aws-powershell-container/pkgs/container/aws-powershell-container

@floh96

ashishdhingra commented 1 year ago

The issue should not happen with the later versions since we use 3 part versions for 4th 0 part. Feel free to open a new issue in case if it is encountered again.

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.