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 78 forks source link

Cannot install on Windows #212

Closed elliott-alt closed 3 years ago

elliott-alt commented 3 years ago

Description

I tried to install for the first time on Windows 10. There is no error message but the modules are not installed.

Reproduction Steps

Logs

This is the result trying to install any service module:

PS C:\Windows\System32> Install-AWSToolsModule AWS.Tools.S3

Confirm
Are you sure you want to perform this action?
Performing the operation "Install-AWSToolsModule" on target "AWS Tools version 4.1.10.0".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
Installing module AWS.Tools.S3 version 4.1.10.0

This also fails using Install-Module. Here is the debug output.

PS C:\Windows\System32> $debugPreference = "Continue"
PS C:\Windows\System32> Install-Module AWS.Tools.S3
DEBUG: 00:00:00.0000001 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0000843 Name: AWS.Tools.S3
DEBUG: 00:00:00.0070834 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0171480 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0392031 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0545660 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0546463 Name: AWS.Tools.S3
DEBUG: 00:00:00.0583156 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0678729 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0860599 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.1011255 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.1012026 Name: AWS.Tools.S3
DEBUG: 00:00:00.1046812 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1
DEBUG: 00:00:00.1140156 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.1328865 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.1514727 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.1515489 Name: AWS.Tools.S3
DEBUG: 00:00:00.1584230 INVOKING PowerShell Fn Get-DynamicOptions with args Install that has length 1
DEBUG: 00:00:00.1711609 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.1953781 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.2465066 Calling SearchForPackages. Name='AWS.Tools.S3'
DEBUG: 00:00:00.2479417 PackageProvider::FindPackage with name AWS.Tools.S3
DEBUG: 00:00:00.2544057 Calling SearchForPackages After Select 1
DEBUG: 00:00:00.2667084 Calling New() : MethodName = 'FindPackage'
DEBUG: 00:00:00.2681796 ProviderName: PowerShellGet
DEBUG: 00:00:00.2696996 Scope: CurrentUser
DEBUG: 00:00:00.2711511 Type: Module
DEBUG: 00:00:00.2726040 Name: AWS.Tools.S3
DEBUG: 00:00:00.2756451 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.2828989 INVOKING PowerShell Fn Find-Package with args System.String[], , ,  that has length 4
DEBUG: 00:00:00.2956283 In PowerShellGet Provider - 'Find-Package'.
DEBUG: 00:00:00.2967015 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:00.2976785 OPTION: Scope => CurrentUser
DEBUG: 00:00:00.2990179 OPTION: Type => Module
DEBUG: 00:00:00.2999888 OPTION: Name => AWS.Tools.S3
DEBUG: 00:00:00.3009547 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.3077641 PackageProvider::FindPackage with name AWS.Tools.S3
DEBUG: 00:00:00.3127472 Calling 'NuGet'::'FindPackage' - name='AWS.Tools.S3', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:00.3138901 Iterating 'AWS.Tools.S3'.
DEBUG: 00:00:00.3156114 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.3172367 Source 'https://www.powershellgallery.com/api/v2' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.3189688 Source 'https://www.powershellgallery.com/api/v2' is validated.
DEBUG: 00:00:00.3217216 Calling 'NuGetRequest'::'GetPackageById', 'AWS.Tools.S3'.
DEBUG: 00:00:00.3231608 Calling 'NuGetPackageRepository'::'FindPackagesById', 'AWS.Tools.S3'.
DEBUG: 00:00:00.3244156 Calling 'NuGetPackageFeed2'::'FindPackage', 'AWS.Tools.S3'.
DEBUG: 00:00:00.3253936 Calling 'NuGetClient'::'FindPackage'.
DEBUG: 00:00:00.3274683 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AWS.Tools.S3'&$skip=0&$top=40'.
DEBUG: 00:00:00.6991556 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AWS.Tools.S3'&$skip=0&$top=40'.
DEBUG: 00:00:00.7038234 '24' packages received in the last request.
DEBUG: 00:00:00.7061998 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AWS.Tools.S3'&$skip=0&$top=40'.
DEBUG: 00:00:00.7821421 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AWS.Tools.S3'&$skip=0&$top=40'.
DEBUG: 00:00:00.7864870 '24' packages received in the last request.
DEBUG: 00:00:00.7901297 Completed iterating for 'AWS.Tools.S3'.
DEBUG: 00:00:00.8130041 Done calling powershell «Find-Package» «PSModule»
DEBUG: 00:00:00.8469360 Calling New() : MethodName = 'GetInstalledPackages'
DEBUG: 00:00:00.8499014 ProviderName: PowerShellGet
DEBUG: 00:00:00.8515770 Scope: CurrentUser
DEBUG: 00:00:00.8527139 Type: Module
DEBUG: 00:00:00.8541329 Name: AWS.Tools.S3
DEBUG: 00:00:00.8554261 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.8594176 INVOKING PowerShell Fn Get-InstalledPackage with args AWS.Tools.S3, 4.1.10.0, ,  that has length 4
DEBUG: 00:00:00.8670928 In PowerShellGet Provider - 'Get-InstalledPackage'.
DEBUG: 00:00:00.8698624 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:00.8710836 OPTION: Scope => CurrentUser
DEBUG: 00:00:00.8723858 OPTION: Type => Module
DEBUG: 00:00:00.8738740 OPTION: Name => AWS.Tools.S3
DEBUG: 00:00:00.8750084 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.9063389 Done calling powershell «Get-InstalledPackage» «PSModule»

Get-Module shows only the installer, no services have been installed. Commands like Get-S3Bucket don't work.

Environment

ashishdhingra commented 3 years ago

Hi @elliott-alt,

Good afternoon.

Could you please try the command Get-Module -Name AWS.Tools.* -ListAvailable and see if it displays the available AWS.Tools.* module(s)? Also, let us know the output of Get-S3Bucket command.

Thanks, Ashish

elliott-alt commented 3 years ago

It shows that it's not installed. I could tell something was weird from the Install-AWSToolsModule command because it did not try to install AWS.Tools.Common.

PS C:\Windows\system32> Get-Module -Name AWS.Tools.* -ListAvailable

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.2.0    AWS.Tools.Installer                 {Uninstall-AWSToolsModule, Install-AWSToolsModule, Update-...

PS C:\Windows\system32> Get-S3Bucket
Get-S3Bucket : The term 'Get-S3Bucket' 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.
At line:1 char:1
+ Get-S3Bucket
+ ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-S3Bucket:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
ashishdhingra commented 3 years ago

Hi @elliott-alt,

Good morning.

Please advise if this is still an issue. Also, could you try running PowerShell console as Administrator, OR, try it on a new machine? Here's is the output from my execution:

PS D:\Users\testuser> Install-Module -Name AWS.Tools.Installer

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y
PS D:\Users\testuser> Install-AWSToolsModule AWS.Tools.S3 -Verbose
VERBOSE: [Install-AWSToolsModule] ConfirmPreference=High WhatIfPreference=False VerbosePreference=Continue Force=False Name=(AWS.Tools.S3) RequiredVersion= SkipUpdate=False CleanUp=False
VERBOSE: [Find-AWSToolsModule] ConfirmPreference=High WhatIfPreference=False VerbosePreference=Continue Name=(AWS.Tools.S3)
VERBOSE: [Find-AWSToolsModule] End
VERBOSE: [Install-AWSToolsModule] Installing AWS Tools version 4.1.11.0
VERBOSE: [Install-AWSToolsModule] Searching installed modules
VERBOSE: [Install-AWSToolsModule] Removing already installed modules from the. Final list of modules to install: (AWS.Tools.S3)

Confirm
Are you sure you want to perform this action?
Performing the operation "Install-AWSToolsModule" on target "AWS Tools version 4.1.11.0".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
VERBOSE: [Install-AWSToolsModule] Create folder for temporary repository D:\Users\testuser\AppData\Local\Temp\3z41cs5s.j3y
VERBOSE: [Install-AWSToolsModule] Registering temporary repository AWSToolsTemp
VERBOSE: [Install-AWSToolsModule] Downloading modules to temporary repository
VERBOSE: [Install-AWSToolsModule] Downloading modules (AWS.Tools.S3)
VERBOSE: [Install-AWSToolsModule] Downloading module AWS.Tools.S3 to D:\Users\testuser\AppData\Local\Temp\3z41cs5s.j3y
VERBOSE: [Get-AWSToolsModuleDependenciesAndValidate] ConfirmPreference=None WhatIfPreference=False VerbosePreference=Continue Name=AWS.Tools.S3 Path=D:\Users\testuser\AppData\Local\Temp\3z41cs5s.j3y\AWS.Tools.S3.4.1.11.0.nupkg
VERBOSE: [Get-AWSToolsModuleDependenciesAndValidate] Manifest signature correctly validated
VERBOSE: [Get-AWSToolsModuleDependenciesAndValidate] Found dependency AWS.Tools.Common
VERBOSE: [Get-AWSToolsModuleDependenciesAndValidate] End
VERBOSE: [Install-AWSToolsModule] Downloading module AWS.Tools.Common to D:\Users\testuser\AppData\Local\Temp\3z41cs5s.j3y
VERBOSE: [Get-AWSToolsModuleDependenciesAndValidate] ConfirmPreference=None WhatIfPreference=False VerbosePreference=Continue Name=AWS.Tools.Common Path=D:\Users\testuser\AppData\Local\Temp\3z41cs5s.j3y\AWS.Tools.Common.4.1.11.0.nupkg
VERBOSE: [Get-AWSToolsModuleDependenciesAndValidate] Manifest signature correctly validated
VERBOSE: [Get-AWSToolsModuleDependenciesAndValidate] End
VERBOSE: [Install-AWSToolsModule] Installing modules (AWS.Tools.S3)
Installing module AWS.Tools.S3 version 4.1.11.0
VERBOSE: [Install-AWSToolsModule] Modules install complete
VERBOSE: [Install-AWSToolsModule] Unregistering temporary repository AWSToolsTemp
VERBOSE: [Install-AWSToolsModule] Delete repository folder D:\Users\testuser\AppData\Local\Temp\3z41cs5s.j3y
VERBOSE: [Install-AWSToolsModule] End
PS D:\Users\testuser> Get-Module -Name AWS.Tools.* -ListAvailable

    Directory: D:\Users\testuser\Documents\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     4.1.11.0              AWS.Tools.Common                    Core,Desk {Clear-AWSHistory, Set-AWSHistoryConfiguration, Init…
Script     1.0.2.1               AWS.Tools.Installer                 Core,Desk {Uninstall-AWSToolsModule, Install-AWSToolsModule, U…
Binary     4.1.11.0              AWS.Tools.S3                        Core,Desk {Add-S3PublicAccessBlock, Copy-S3Object, Get-S3ACL, …

Thanks, Ashish

elliott-alt commented 3 years ago

I was already running as admin, and I tried reinstalling a few times and rebooting. Anyway, I'm not sure what changed but now it's working fine.