File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/PowerShellEditorServices/Session Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1930,7 +1930,18 @@ private SessionDetails GetSessionDetailsInDebugger()
1930
1930
1931
1931
private SessionDetails GetSessionDetailsInNestedPipeline ( )
1932
1932
{
1933
- return GetSessionDetailsInRunspace ( this . CurrentRunspace . Runspace ) ;
1933
+ // We don't need to check what thread we're on here. If it's a local
1934
+ // nested pipeline then we will already be on the correct thread, and
1935
+ // non-debugger nested pipelines aren't supported in remote runspaces.
1936
+ return this . GetSessionDetails (
1937
+ command =>
1938
+ {
1939
+ using ( var localPwsh = PowerShell . Create ( RunspaceMode . CurrentRunspace ) )
1940
+ {
1941
+ localPwsh . Commands = command ;
1942
+ return localPwsh . Invoke ( ) . FirstOrDefault ( ) ;
1943
+ }
1944
+ } ) ;
1934
1945
}
1935
1946
1936
1947
private void SetProfileVariableInCurrentRunspace ( ProfilePaths profilePaths )
You can’t perform that action at this time.
0 commit comments