Posh-SSH: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0
Hi,
I am trying to load Posh-SSH from a vmware/powerclicore docker image but cannot load it.
PS /root> Install-Module -Name Posh-SSH -RequiredVersion 3.0.4 -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 '3.0.4' of module 'Posh-SSH'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.
VERBOSE: The specified module will be installed in '/root/.local/share/powershell/Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'Posh-SSH' with version '3.0.4' 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='3.0.4',destination='/tmp/1212229673'
VERBOSE: DownloadPackage' - name='Posh-SSH', version='3.0.4',destination='/tmp/1212229673/Posh-SSH.3.0.4/Posh-SSH.3.0.4.nupkg', uri='https://www.powershellgallery.com/api/v2/package/Posh-SSH/3.0.4'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/Posh-SSH/3.0.4'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/Posh-SSH/3.0.4'.
VERBOSE: Completed downloading 'Posh-SSH'.
VERBOSE: InstallPackageLocal' - name='Posh-SSH', version='3.0.4',destination='/tmp/1212229673'
VERBOSE: Validating the 'Posh-SSH' module contents under '/tmp/1212229673/Posh-SSH.3.0.4' path.
VERBOSE: Test-ModuleManifest successfully validated the module manifest file '/tmp/1212229673/Posh-SSH.3.0.4'.
VERBOSE: Module 'Posh-SSH' was installed successfully to path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4'.
PS /root> Import-Module -Name Posh-SSH -Verbose
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Posh-SSH.psd1'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/Newtonsoft.Json.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/Newtonsoft.Json.dll'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/Renci.SshNet.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/Renci.SshNet.dll'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/SshNet.Security.Cryptography.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/SshNet.Security.Cryptography.dll'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Format/SSHSession.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Format/SFTPSession.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Format/Renci.SshNet.SshCommand.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Format/Renci.SshNet.Sftp.SftpFile.Format.ps1xml'.
Import-Module: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
Here is the versions of powershell
Name Value
---- -----
PSVersion 7.1.5
PSEdition Core
GitCommitId 7.1.5
OS Linux 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
I hope you have a solution.
regards,
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 24 (12 by maintainers)
Same error occuring for me on Windows in PowerShell version 6 and 7