-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
- Create a Hyper-V VM with a current version of Windows 11 (No network adapter needs to be connected)
- Install PowerShell 7.5.3 or later on the host
- Install PowerShell 7.5.3 or later in that VM.
- In the VM open an elevated pwsh and execute
Enable-PSRemoting -SkipNetworkProfileCheck - On the host run this command:
$PSDefaultParameterValues."Invoke-Command:ConfigurationName" = "PowerShell.7" Invoke-Command -VMName MyTestVMName -Credential Developer -Command { while($true) { Get-Date Start-Sleep -Seconds 10 } }
- Wait for 10 minutes
Expected behavior
The Invoke-Command still continues until we manually abort itActual behavior
After 10 minutes, the command ends with this error message:
OpenError: [MyTestVMName] The background process reported an error with the following message: "The Hyper-V socket target process has ended."Error details
Exception :
Type : System.Management.Automation.Remoting.PSRemotingTransportException
ErrorCode : 2100
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : The background process reported an error with the following message: "The
Hyper-V socket target process has ended.".
HResult : -2146233087
CategoryInfo : ResourceUnavailable: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId :
System.Management.Automation.Remoting.PSRemotingDataStructureException
Message : The background process reported an error with the following message: "The Hyper-V
socket target process has ended.".
HResult : -2146233087
TargetObject : MyTestVMName
CategoryInfo : OpenError: (TestVM_3bd5e6b2-09e…8-9527-338d91126c3a:String) [],
PSRemotingTransportException
FullyQualifiedErrorId : 2100,PSSessionStateBroken
ErrorDetails : [MyTestVMName] The background process
reported an error with the following message: "The Hyper-V socket target process has ended.".Environment data
Name Value
---- -----
PSVersion 7.5.3
PSEdition Core
GitCommitId 7.5.3
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
Since PowerShell 7.5.3 we are experiencing an issue when executing long-running commands in Hyper-V VMs. After pretty exactly 10 minutes of usage the connection gets closed. It only happens if it is a single Invoke-Command that takes that much time. Running many short Invoke-Commands with the same session does not lead to this behaviour.
We are doing this on managed Windows 11 office computers. For some time on a few clients the issue did not seem to occur but now does as well. When rolling back to PowerShell 7.5.2 we don't see this issue anymore. With all of these versions, the error was reproducable for me:
- 7.5.3
- 7.5.4
- 7.6.0.preview 5
- Windows PowerShell 5.1
Due to the comments in the previous issue (#26176) and these observations, i assume that something in Windows got bugged by an update but that PowerShell 7.5.2 had some way to still work.