Dear Jonas,
From what you've described, it appears that long-running Invoke-Command sessions targeting Hyper-V VMs are being terminated after approximately 10 minutes, resulting in the error:
OperationStopped: The background process reported an error with the following message: "The Hyper-V socket target process has ended."
This behavior is reproducible with persistent script blocks but not with repeated short-lived invocations, which strongly suggests a timeout or session management change affecting continuous remote execution.
Given that:
You're using PowerShell 7.5.3 on both host and guest,
The issue occurs across multiple VM setups (scripted and manual),
Some hosts still behave normally,
…it’s likely that a recent Windows update introduced a change in how Hyper-V socket sessions are managed—possibly enforcing a timeout for idle or long-running connections.
Here are Suggested next steps
- Check for timeout policies or session limits Review any recent Group Policy or local policy changes related to remote management or PowerShell session limits. Look into
WSMansettings using:- Code
and verify values likeGet-Item -Path WSMan:\localhost\ShellIdleTimeoutandMaxIdleTimeout.
- Code
- Test with ConfigurationName set to "" You mentioned the issue persists even when using Windows PowerShell remotely. Still, testing with
ConfigurationName = ""may help isolate whether the issue is tied to PowerShell 7 endpoints. - Compare with unaffected hosts If possible, compare the update history and remoting configurations of the hosts that do not exhibit the issue. This may help pinpoint the change.
- Temporary workaround As you've discovered, breaking the loop into repeated short
Invoke-Commandcalls avoids the timeout. While not ideal, this may serve as a temporary workaround until the root cause is identified. - Escalate through official support channels If the issue persists and no configuration explains the behavior, we recommend opening a support case with Microsoft to investigate whether this is a regression or an intentional change.
- Test with ConfigurationName set to "" You mentioned the issue persists even when using Windows PowerShell remotely. Still, testing with
ConfigurationName = ""may help isolate whether the issue is tied to PowerShell 7 endpoints. Compare with unaffected hosts If possible, compare the update history and remoting configurations of the hosts that do not exhibit the issue. This may help pinpoint the change. Temporary workaroundAs you've discovered, breaking the loop into repeated short `Invoke-Command` calls avoids the timeout. While not ideal, this may serve as a temporary workaround until the root cause is identified. **Escalate through official support channels** If the issue persists and no configuration explains the behavior, we recommend opening a support case with Microsoft to investigate whether this is a regression or an intentional change.
If this guidance proves helpful, feel free to click “Accept Answer” so we know we’re heading in the right direction 😊. And of course, I’m here if you need further clarification or support. T&B, Domic Vo