@@ -63,17 +63,17 @@ internal class PsesInternalHost : PSHost, IHostSupportsInteractiveSession, IRuns
63
63
64
64
private EngineIntrinsics _mainRunspaceEngineIntrinsics ;
65
65
66
- private bool _shouldExit = false ;
66
+ private bool _shouldExit ;
67
67
68
- private int _shuttingDown = 0 ;
68
+ private int _shuttingDown ;
69
69
70
70
private string _localComputerName ;
71
71
72
72
private ConsoleKeyInfo ? _lastKey ;
73
73
74
- private bool _skipNextPrompt = false ;
74
+ private bool _skipNextPrompt ;
75
75
76
- private bool _resettingRunspace = false ;
76
+ private bool _resettingRunspace ;
77
77
78
78
public PsesInternalHost (
79
79
ILoggerFactory loggerFactory ,
@@ -126,6 +126,8 @@ public PsesInternalHost(
126
126
127
127
public override string Name { get ; }
128
128
129
+ public override PSObject PrivateData => _hostInfo . PSHost . PrivateData ;
130
+
129
131
public override PSHostUserInterface UI { get ; }
130
132
131
133
public override Version Version { get ; }
@@ -156,25 +158,13 @@ public PsesInternalHost(
156
158
157
159
private bool ShouldExitExecutionLoop => _shouldExit || _shuttingDown != 0 ;
158
160
159
- public override void EnterNestedPrompt ( )
160
- {
161
- PushPowerShellAndRunLoop ( CreateNestedPowerShell ( CurrentRunspace ) , PowerShellFrameType . Nested ) ;
162
- }
161
+ public override void EnterNestedPrompt ( ) => PushPowerShellAndRunLoop ( CreateNestedPowerShell ( CurrentRunspace ) , PowerShellFrameType . Nested ) ;
163
162
164
- public override void ExitNestedPrompt ( )
165
- {
166
- SetExit ( ) ;
167
- }
163
+ public override void ExitNestedPrompt ( ) => SetExit ( ) ;
168
164
169
- public override void NotifyBeginApplication ( )
170
- {
171
- _hostInfo . PSHost . NotifyBeginApplication ( ) ;
172
- }
165
+ public override void NotifyBeginApplication ( ) => _hostInfo . PSHost . NotifyBeginApplication ( ) ;
173
166
174
- public override void NotifyEndApplication ( )
175
- {
176
- _hostInfo . PSHost . NotifyEndApplication ( ) ;
177
- }
167
+ public override void NotifyEndApplication ( ) => _hostInfo . PSHost . NotifyEndApplication ( ) ;
178
168
179
169
public void PopRunspace ( )
180
170
{
@@ -188,11 +178,8 @@ public void PushRunspace(Runspace runspace)
188
178
PushPowerShellAndRunLoop ( CreatePowerShellForRunspace ( runspace ) , PowerShellFrameType . Remote ) ;
189
179
}
190
180
191
- public override void SetShouldExit ( int exitCode )
192
- {
193
- // TODO: Handle exit code if needed
194
- SetExit ( ) ;
195
- }
181
+ // TODO: Handle exit code if needed
182
+ public override void SetShouldExit ( int exitCode ) => SetExit ( ) ;
196
183
197
184
/// <summary>
198
185
/// Try to start the PowerShell loop in the host.
0 commit comments