Posh-SSH
Posh-SSH copied to clipboard
Issue install Posh-SSH on server 2019
I am having issues installing Posh-SSH from the gallery on a freshly loaded Server 2019 vm. I have reviewed a number write up/kb but still unable to install it. I am able to install it on Win10 and have also tried on new test 2019 server:
I have open the powershell as administrator and set the execution policy to unrestricted and even made psgallery a trusted site all on my test server but I still get the same error. I had seen something about an update causing a conflict with a windows update and Renci.SshNet.
PS C:\Users\administrator> Install-Module -Name Posh-SSH -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='Posh-SSH'' for ''. VERBOSE: Total package yield:'1' for the specified package 'Posh-SSH'. VERBOSE: Performing the operation "Install-Module" on target "Version '2.2' of module 'Posh-SSH'". VERBOSE: The installation scope is specified to be 'AllUsers'. VERBOSE: The specified module will be installed in 'C:\Program Files (x86)\WindowsPowerShell\Modules'. VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'. VERBOSE: Downloading module 'Posh-SSH' with version '2.2' from the repository 'https://www.powershellgallery.com/api/v2'. VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Posh-SSH'' for ''. VERBOSE: InstallPackage' - name='Posh-SSH', version='2.2',destination='C:\Users\administrator\AppData\Local\Temp\2\1174176679' VERBOSE: DownloadPackage' - name='Posh-SSH', version='2.2',destination='C:\Users\administrator\AppData\Local\Temp\2\1174176679\Posh-SSH\Posh-SSH.nupkg', uri='https://www.powershellgallery.com/api/v2/package/Posh-SSH/2.2.0' VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/Posh-SSH/2.2.0'. VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/Posh-SSH/2.2.0'. VERBOSE: Completed downloading 'Posh-SSH'. VERBOSE: Hash for package 'Posh-SSH' does not match hash provided from the server. VERBOSE: InstallPackageLocal' - name='Posh-SSH', version='2.2',destination='C:\Users\administrator\AppData\Local\Temp\2\1174176679' PackageManagement\Install-Package : The member 'FileList' in the module manifest is not valid: Could not load file or assembly 'Renci.SshNet, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. Verify that a valid value is specified for this field in the 'C:\Users\administrator\AppData\Local\Temp\2\1174176679\Posh-SSH\Posh-SSH.psd1' file. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
- ... $null = PackageManagement\Install-Package @PSBoundParameters
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : ResourceUnavailable: (C:\Users\admini...H\Posh-SSH.psd1:String) [Install-Package], Exception
- FullyQualifiedErrorId : Modules_InvalidManifest,Microsoft.PowerShell.Commands.TestModuleManifestCommand,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
Any suggestions? Thanks
VERBOSE: Hash for package 'Posh-SSH' does not match hash provided from the server.
This looks like a hashing issue with the server downloading the module from PS Gallery.
You might try doing Save-Module Posh-SSH -Path 'C:\Modules'
(or some other path)...then see if it will download it completely.
The other message of interest is this one:
VERBOSE: The specified module will be installed in 'C:\Program Files (x86)\WindowsPowerShell\Modules'.
I believe this module is compiled for 64-bit, but not sure why your server is trying to put it in that module path. You might verify what modules path show up for $env:PSModulePath -split ";"
.
The main issue is that Microsoft in a storage component included in the OS an old version of the same library as Posh-SSH and it causes a conflict since it loads that one first. The module runs on both x64 and x86.
On May 21, 2020, at 5:16 PM, Shawn Melton [email protected] wrote:
VERBOSE: Hash for package 'Posh-SSH' does not match hash provided from the server.
This looks like a hashing issue with the server downloading the module from PS Gallery.
You might try doing Save-Module Posh-SSH -Path 'C:\Modules' (or some other path)...then see if it will download it completely.
The other message of interest is this one:
VERBOSE: The specified module will be installed in 'C:\Program Files (x86)\WindowsPowerShell\Modules'.
I believe this module is compiled for 64-bit, but not sure why your server is trying to put it in that module path. You might verify what modules path show up for $env:PSModulePath -split ";".
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/darkoperator/Posh-SSH/issues/330#issuecomment-632350504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD7IHQ3OBVVW5KIIVRONX3RSWK25ANCNFSM4NGJINRQ.
Can you test Beta 1 https://github.com/darkoperator/Posh-SSH/releases/tag/Beta1
The $env:PSModulePath -split ";" had listed the following:
C:\Users\nonadminuserid\Documents\WindowsPowerShell\Modules C:\Program Files\WindowsPowerShell\Modules C:\Windows\system32\WindowsPowerShell\v1.0\Modules E:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\
I only found the POSH-SSH module installed in: C:\Program Files\WindowsPowerShell\Modules\Posh-SSH
I will try Beta1
When I ran Save-Module Posh-SSH -Path 'C:\Modules' it downloaded and saved the files to the folder
The beta is not in the gallery it is here in Github, you will need to download, unblock and load by had. Not in the gallery because thousands of people are not pinning by version and it could cripple some production environments and it is safer to put in the github releases.
@darkoperator the PowerShell Gallery does allow you to publish "pre-release" versions of your module. This will not get pulled if someone is not pinning the version because in order to get pre-release versions you have to provide the flag -AllowPrerelease
. If I have version 2.3 on my machine and you release something flagged as pre-release, then if I just run Install-Module posh-ssh -Force
it will not grab it; they have to do Install-Module posh-ssh -AllowPrerelease
.
PSReadline is primary module I know uses this feature, you will generally see them add -beta
to the actual version name (likely just for build, meaning once it is out of beta they just drop that from the version number and can publish it with the same number on the Gallery):
It offers a much more broader method for you to get your content out to the masses for alpha and beta testing. (Would have made deployment for a customer a bit easier 😉 where I had to use the beta release.)
Thanks for the info. You are right will do a release soon on the gallery of the beta
https://www.powershellgallery.com/packages/Posh-SSH/2.3.0-Beta1