Closed
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
- Install PowerShell v7.3.0 on a remote computer.
- Execute the following PowerShell script on the local machine:
New-PSSession -ComputerName <remote-computer> -Credential (Get-Credential) | Enter-PSSession;
The issue occurs when the remote computer has PowerShell v7.3.0 installed. It works fine when PowerShell v7.2.7 is installed on the remote computer.
Expected behavior
A remote PowerShell session is created and opened.
Actual behavior
The following error occurs:
New-PSSession: [<remote-computer>] Connecting to remote server <remote-computer> failed with the following error message : Could not load file or assembly 'System.Security.Cryptography, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. For more information, see the about_Remote_Troubleshooting Help topic.
Error details
Exception :
Type : System.Management.Automation.Remoting.PSRemotingTransportException
ErrorCode : -2141974624
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : Connecting to remote server <remote-computer> failed with the following error message : Could not load file or assembly
'System.Security.Cryptography, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. For more
information, see the about_Remote_Troubleshooting Help topic.
HResult : -2146233087
CategoryInfo : ResourceUnavailable: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException
Message : Connecting to remote server remote-computer failed with the following error message : Could not load file or assembly
'System.Security.Cryptography, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. For more
information, see the about_Remote_Troubleshooting Help topic.
HResult : -2146233087
TargetObject : System.Management.Automation.RemoteRunspace
CategoryInfo : OpenError: (System.Management.A…tion.RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
FullyQualifiedErrorId : IncorrectProtocolVersion,PSSessionOpenFailed
ErrorDetails : [remote-computer] Connecting to remote server remote-computer failed with the following error message : Could not load file or assembly
'System.Security.Cryptography, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. For more
information, see the about_Remote_Troubleshooting Help topic.
InvocationInfo :
MyCommand : New-PSSession
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 66
Line : New-PSSession -ComputerName <remote-computer> -Credential (Get-Credential) | Enter-PSSession;
PositionMessage : At line:1 char:1
+ New-PSSession -ComputerName <remote-computer> -Credential (Get-Credential) | En …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : New-PSSession
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
Local machine:
Name Value
---- -----
PSVersion 7.3.0
PSEdition Core
GitCommitId 7.3.0
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Remote machine:
Name Value
---- -----
PSVersion 7.3.0
PSEdition Core
GitCommitId 7.3.0
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response