MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
448 stars 157 forks source link

Error when try to install the Module #143

Closed shayki5 closed 5 years ago

shayki5 commented 5 years ago

Steps to reproduce

Install-Module -Name VSTeam

Expected behavior

The module will be installed

Actual behavior

PackageManagement\Install-Package : The module 'SHiPS' cannot be installed or updated because the authenticode signature of the file 'SHiPS.psd1' is not valid.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : InvalidAuthenticodeSignature,ValidateAndGet-AuthenticodeSignature,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Environment data

> Get-VSTeamAPIVersion
DON'T HAVE
> $PSVersionTable
Name                           Value                                                                                                                                           
----                           -----                                                                                                                                           
PSVersion                      5.1.16299.820                                                                                                                                   
PSEdition                      Desktop                                                                                                                                         
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                         
BuildVersion                   10.0.16299.820                                                                                                                                  
CLRVersion                     4.0.30319.42000                                                                                                                                 
WSManStackVersion              3.0                                                                                                                                             
PSRemotingProtocolVersion      2.3                                                                                                                                             
SerializationVersion           1.1.0.1    
DarqueWarrior commented 5 years ago

I am going to find someone from the ships team. You can also try and install the ships module separately. If it is there it should not try and install again.

HemantMahawar commented 5 years ago

@shayki5 I can't reproduce this issue.

//cc @jianyunt for additional input

jianyunt commented 5 years ago

I cann't repro the issue either. I tried

install-module ships -force -verbose -Repository psgallery

PS E:\> get-module Packagemanagement

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.2.0      PackageManagement                   {Find-Package, Find-PackageProvider, Get-Package, Get-PackageProvi...

PS E:\> get-module PowerShellGet

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.0.0      PowerShellGet                       {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability...}
smurawski commented 5 years ago

Yeah, it looks like an old version of PowerShellGet is the problem.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809

@shayki5 as @HemantMahawar suggested, sharing the result of get-module PowershellGet -listavailable may highlight the problem.

The other option is that the certificate store is out of date on the machine, so it can't validate the signature on the module.

shayki5 commented 5 years ago

Hi all,

Get-Module PowerShellGet -ListAvailable
ModuleType Version    Name                                ExportedCommands                                                          
---------- -------    ----                                ----------------                                                          
Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}   
Get-PSRepository
Name                      InstallationPolicy   SourceLocation                                                                       
----                      ------------------   --------------                                                                       
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2  

Thank you!

DarqueWarrior commented 5 years ago

Did upgrading your PowerShellGet fix your issue.

kilasuit commented 5 years ago

@shayki5 - You will need to upgrade PowerShellGet as the 1.0.0.1 version was included in the initial Windows 10 release and I saw this "version" be updated many many times, without the version being bumped up as part of the Windows Insider Program and it has many flaws, this being one of them

shayki5 commented 5 years ago

I upgraded the PowerShellGet with:

Install-Module –Name PowerShellGet –Force

Now I have this results:

ModuleType Version    Name                                ExportedCommands                                                          
---------- -------    ----                                ----------------                                                          
Script     2.0.4      PowerShellGet                       {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability...}     
Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}   

The same issue still exist, how can I remove the 1.0.0.1?

DarqueWarrior commented 5 years ago

I just checked my version of PowerShellGet and I am running 1.0.0.1 but I have none of these issues.

DarqueWarrior commented 5 years ago

Have you tried since version 6.0.0 was released? I want to see if we can close this.

beatcracker commented 5 years ago

Doesn't work for me. I was only able to install this module with -SkipPublisherCheck.

OS

Microsoft Windows [Version 10.0.16299.431]

Module versions

> Get-Module PowerShellGet, PackageManagement -ListAvailable | select Name,Version | sort Name

Name              Version
----              -------
PackageManagement 1.0.0.1
PackageManagement 1.4.4
PackageManagement 1.0.0.1
PowerShellGet     1.0.0.1
PowerShellGet     2.2.1  
PowerShellGet     1.0.0.1

PS Repositories

> Get-PSRepository

Name      InstallationPolicy SourceLocation
----      ------------------ --------------
PSGallery Trusted            https://www.powershellgallery.com/api/v2

Install log

> Install-Module -Name VSTeam -Scope CurrentUser -Force -Verbose
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='VSTeam'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'VSTeam'.
VERBOSE: Performing the operation "Install-Module" on target "Version '6.3.3' of module 'VSTeam'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.
VERBOSE: The specified module will be installed in 'C:\Users\beatcracker\Documents\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'VSTeam' with version '6.3.3' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='VSTeam'' for ''.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='SHiPS'' for ''.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Trackyon.Utils'' for ''.
VERBOSE: InstallPackage' - name='SHiPS', version='0.8.1',destination='C:\Users\beatcracker\AppData\Local\Temp\556642063'
VERBOSE: DownloadPackage' - name='SHiPS', version='0.8.1',destination='C:\Users\beatcracker\AppData\Local\Temp\556642063\SHiPS\SHiPS.nupkg', uri='https://www.powershellgallery.com/api/v2/package/SHiPS/0.8.1'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/SHiPS/0.8.1'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/SHiPS/0.8.1'.
VERBOSE: Completed downloading 'SHiPS'.
VERBOSE: Hash for package 'SHiPS' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='SHiPS', version='0.8.1',destination='C:\Users\beatcracker\AppData\Local\Temp\556642063'
VERBOSE: InstallPackage' - name='Trackyon.Utils', version='0.0.2',destination='C:\Users\beatcracker\AppData\Local\Temp\556642063'
VERBOSE: DownloadPackage' - name='Trackyon.Utils', version='0.0.2',destination='C:\Users\beatcracker\AppData\Local\Temp\556642063\Trackyon.Utils\Trackyon.Utils.nupkg', uri='https://www.powershellgallery.com/api/v2/package/Trackyon.Utils/0.0.2'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/Trackyon.Utils/0.0.2'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/Trackyon.Utils/0.0.2'.
VERBOSE: Completed downloading 'Trackyon.Utils'.
VERBOSE: Hash for package 'Trackyon.Utils' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='Trackyon.Utils', version='0.0.2',destination='C:\Users\beatcracker\AppData\Local\Temp\556642063'
VERBOSE: InstallPackage' - name='VSTeam', version='6.3.3',destination='C:\Users\beatcracker\AppData\Local\Temp\556642063'
VERBOSE: DownloadPackage' - name='VSTeam', version='6.3.3',destination='C:\Users\beatcracker\AppData\Local\Temp\556642063\VSTeam\VSTeam.nupkg', uri='https://www.powershellgallery.com/api/v2/package/VSTeam/6.3.3'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/VSTeam/6.3.3'.
VERBOSE: Catalog file 'SHiPS.cat' is not found in the contents of the module 'SHiPS' being installed.
PackageManagement\Install-Package : The module 'SHiPS' cannot be installed or updated because the authenticode signature of the file 'SHiPS.psd1' is not valid.
At C:\Program Files (x86)\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : InvalidAuthenticodeSignature,ValidateAndGet-AuthenticodeSignature,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
smurawski commented 5 years ago

@beatcracker The error is with the ShiPS module. Feedback can be provided at https://github.com/PowerShell/ShiPS/

binte commented 4 years ago

I am getting the exact same error on an Azure DevOps pipeline, even though the same code works locally. I am using an windows-2019 agent for the run. Any idea how can I solve this? I can't find any information on this error besides this thread

SebastianSchuetze commented 4 years ago

This must be a problem with the ShiPS module. Can you try to use -SkipPublisherCheck?

binte commented 4 years ago

@SebastianSchuetze that did the trick for me, thank you!

v3manku commented 4 years ago

i still dont see even if i use -SkippublisherCheck

PS C:\Manoj> Install-Module -Name snTeamsTest -Force -SkipPublisherCheck PackageManagement\Install-Package : The following commands are already available on this system:' Add-TeamUser,Connect-MicrosoftTeams,Disconnect-MicrosoftTeams,Get-CsBatchPolicyAssignmentOperatio n,Get-CsPolicyPackage,Get-CsUserPolicyPackage,Get-CsUserPolicyPackageRecommendation,Get-Team,Get- TeamChannel,Get-TeamsApp,Get-TeamUser,Grant-CsUserPolicyPackage,New-CsBatchPolicyPackageAssignmen tOperation,New-Team,New-TeamChannel,New-TeamsApp,Remove-Team,Remove-TeamChannel,Remove-TeamsApp,R emove-TeamUser,Set-Team,Set-TeamArchivedState,Set-TeamChannel,Set-TeamPicture,Set-TeamsApp'. This module 'snTeamsTest' may override the existing commands. If you still want to install this module 'snTeamsTest', use -AllowClobber parameter. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.1.2\PSModule.psm1:9349 char:21

kilasuit commented 4 years ago

@v3manku - That error message tells you that you need to add the -AllowClobber parameter as well.

SebastianSchuetze commented 4 years ago

@v3manku your error message has nothing to do with this module. You are trying to install a module snTeamsTest, which is none of ours. Is your problem related to the VSTeam module?

v3manku commented 4 years ago

Thank you. You are right, this is from PS gallery

https://www.powershellgallery.com/packages/VSTeam/6.4.1

khushboo6 commented 3 years ago

-SkipPublisherCheck worked for me even with version1.0.0.1. thanks!

saadisher39891 commented 2 years ago

Hi Folks I need a help I am using docker pull mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022 now I do docker run -it I am in now if I try to install any thing I get image ^ The module 'DockerMsftProvider' cannot be installed or updated because the authenticode signature of the file | 'DockerMsftProvider.psd1' is not valid. Please help me my obective is to pull docker container and add dcoker cli with azcli in it any suggestions please using docker file

SebastianSchuetze commented 2 years ago

I think you are in the wrong project. This is only about the VSTeam module.

If you have general questions I would recommend stack overflow.

AlexisHW commented 2 years ago

ShiPS module is still incorrectly signed. -SkipPublisherCheck still helps to ignore it's issue and install VSTeam module.

theUltimateZoltan commented 1 year ago

-SkipPublisherCheck worked for me also. Thanks!