PowerShell / PowerShell/PowerShell
CreateOutOfProcessRunspace fails to Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 55.5k
- Forks
- 8.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 88
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
I am trying to run the following script
function Get-PowerShellVersion {
$PSVersionTable.PSVersion
}
$psVersion = Get-PowerShellVersion
$typeTable = [System.Management.Automation.Runspaces.TypeTable]::new([string[]]@())
$powershellInstance = [System.Management.Automation.Runspaces.PowerShellProcessInstance]::new($psVersion, $null, $null, $true)
$runspace = [System.Management.Automation.Runspaces.RunspaceFactory]::CreateOutOfProcessRunspace($typeTable, $powershellInstance)
$runspace.Open()
Expected behavior
$runspace.Open() should succeed.
Actual behavior
Fails with Error
System.Management.Automation.Remoting.PSRemotingTransportException: The background process reported an error with the following message: W i n d o w s P o w e r S h e l l t e r m i n a t e d w i t h t h e f o l l o w i n g e r r o r : .
at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndOpen(IAsyncResult asyncResult)
at System.Management.Automation.Runspaces.Internal.RemoteRunspacePoolInternal.Open()
at System.Management.Automation.Runspaces.RunspacePool.Open()
at System.Management.Automation.RemoteRunspace.Open()
Error details
No response
Environment data
Name Value
---- -----
PSVersion 5.1.17763.5820
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.5820
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Visuals
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the PowerShell script through CreateOutOfProcessRunspace and Runspace.Open() using the reported Windows PowerShell environment. Trace the background process failure and compare the reported PowerShellProcessInstance version and remoting setup; done means the runspace opens successfully without the PSRemotingTransportException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100