1111using System . Collections . Generic ;
1212using System . Globalization ;
1313using System . Management . Automation . Host ;
14- using SMA = System . Management . Automation ;
14+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Debugging ;
15+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Execution ;
16+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Utility ;
17+ using Microsoft . PowerShell . EditorServices . Utility ;
18+ using System . IO ;
19+ using System . Reflection ;
20+ using System . Text ;
21+ using System . Threading ;
22+ using System . Threading . Tasks ;
1523
1624namespace Microsoft . PowerShell . EditorServices . Services . PowerShell . Host
1725{
18- using Microsoft . PowerShell . EditorServices . Services . PowerShell . Debugging ;
19- using Microsoft . PowerShell . EditorServices . Services . PowerShell . Execution ;
20- using Microsoft . PowerShell . EditorServices . Services . PowerShell . Utility ;
21- using Microsoft . PowerShell . EditorServices . Utility ;
22- using System . IO ;
2326 using System . Management . Automation ;
2427 using System . Management . Automation . Runspaces ;
25- using System . Reflection ;
26- using System . Text ;
27- using System . Threading ;
28- using System . Threading . Tasks ;
2928
3029 internal class PsesInternalHost : PSHost , IHostSupportsInteractiveSession , IRunspaceContext , IInternalPowerShellExecutionService
3130 {
@@ -117,7 +116,7 @@ public PsesInternalHost(
117116
118117 public RunspaceInfo CurrentRunspace => CurrentFrame . RunspaceInfo ;
119118
120- public SMA . PowerShell CurrentPowerShell => CurrentFrame . PowerShell ;
119+ public PowerShell CurrentPowerShell => CurrentFrame . PowerShell ;
121120
122121 public EditorServicesConsolePSHost PublicHost { get ; }
123122
@@ -253,7 +252,7 @@ public void CancelCurrentTask()
253252 public Task < TResult > ExecuteDelegateAsync < TResult > (
254253 string representation ,
255254 ExecutionOptions executionOptions ,
256- Func < SMA . PowerShell , CancellationToken , TResult > func ,
255+ Func < PowerShell , CancellationToken , TResult > func ,
257256 CancellationToken cancellationToken )
258257 {
259258 return InvokeTaskOnPipelineThreadAsync ( new SynchronousPSDelegateTask < TResult > ( _logger , this , representation , executionOptions ?? ExecutionOptions . Default , func , cancellationToken ) ) ;
@@ -262,7 +261,7 @@ public Task<TResult> ExecuteDelegateAsync<TResult>(
262261 public Task ExecuteDelegateAsync (
263262 string representation ,
264263 ExecutionOptions executionOptions ,
265- Action < SMA . PowerShell , CancellationToken > action ,
264+ Action < PowerShell , CancellationToken > action ,
266265 CancellationToken cancellationToken )
267266 {
268267 return InvokeTaskOnPipelineThreadAsync ( new SynchronousPSDelegateTask ( _logger , this , representation , executionOptions ?? ExecutionOptions . Default , action , cancellationToken ) ) ;
@@ -325,13 +324,13 @@ public IReadOnlyList<TResult> InvokePSCommand<TResult>(PSCommand psCommand, Powe
325324 public void InvokePSCommand ( PSCommand psCommand , PowerShellExecutionOptions executionOptions , CancellationToken cancellationToken )
326325 => InvokePSCommand < PSObject > ( psCommand , executionOptions , cancellationToken ) ;
327326
328- public TResult InvokePSDelegate < TResult > ( string representation , ExecutionOptions executionOptions , Func < SMA . PowerShell , CancellationToken , TResult > func , CancellationToken cancellationToken )
327+ public TResult InvokePSDelegate < TResult > ( string representation , ExecutionOptions executionOptions , Func < PowerShell , CancellationToken , TResult > func , CancellationToken cancellationToken )
329328 {
330329 var task = new SynchronousPSDelegateTask < TResult > ( _logger , this , representation , executionOptions , func , cancellationToken ) ;
331330 return task . ExecuteAndGetResult ( cancellationToken ) ;
332331 }
333332
334- public void InvokePSDelegate ( string representation , ExecutionOptions executionOptions , Action < SMA . PowerShell , CancellationToken > action , CancellationToken cancellationToken )
333+ public void InvokePSDelegate ( string representation , ExecutionOptions executionOptions , Action < PowerShell , CancellationToken > action , CancellationToken cancellationToken )
335334 {
336335 var task = new SynchronousPSDelegateTask ( _logger , this , representation , executionOptions , action , cancellationToken ) ;
337336 task . ExecuteAndGetResult ( cancellationToken ) ;
@@ -361,7 +360,7 @@ private void Run()
361360 return ( pwsh , localRunspaceInfo ) ;
362361 }
363362
364- private void PushPowerShellAndRunLoop ( SMA . PowerShell pwsh , PowerShellFrameType frameType , RunspaceInfo newRunspaceInfo = null )
363+ private void PushPowerShellAndRunLoop ( PowerShell pwsh , PowerShellFrameType frameType , RunspaceInfo newRunspaceInfo = null )
365364 {
366365 // TODO: Improve runspace origin detection here
367366 if ( newRunspaceInfo is null )
@@ -379,7 +378,7 @@ private void PushPowerShellAndRunLoop(SMA.PowerShell pwsh, PowerShellFrameType f
379378 PushPowerShellAndRunLoop ( new PowerShellContextFrame ( pwsh , newRunspaceInfo , frameType ) ) ;
380379 }
381380
382- private RunspaceInfo GetRunspaceInfoForPowerShell ( SMA . PowerShell pwsh , out bool isNewRunspace , out RunspaceFrame oldRunspaceFrame )
381+ private RunspaceInfo GetRunspaceInfoForPowerShell ( PowerShell pwsh , out bool isNewRunspace , out RunspaceFrame oldRunspaceFrame )
383382 {
384383 oldRunspaceFrame = null ;
385384
0 commit comments