@@ -20,21 +20,13 @@ internal static class PsesHostFactory
20
20
// NOTE: These paths are arbitrarily chosen just to verify that the profile paths can be set
21
21
// to whatever they need to be for the given host.
22
22
23
- public static readonly ProfilePathInfo TestProfilePaths =
24
- new (
25
- Path . GetFullPath (
26
- TestUtilities . NormalizePath ( "../../../../PowerShellEditorServices.Test.Shared/Profile/Test.PowerShellEditorServices_profile.ps1" ) ) ,
27
- Path . GetFullPath (
28
- TestUtilities . NormalizePath ( "../../../../PowerShellEditorServices.Test.Shared/Profile/ProfileTest.ps1" ) ) ,
29
- Path . GetFullPath (
30
- TestUtilities . NormalizePath ( "../../../../PowerShellEditorServices.Test.Shared/Test.PowerShellEditorServices_profile.ps1" ) ) ,
31
- Path . GetFullPath (
32
- TestUtilities . NormalizePath ( "../../../../PowerShellEditorServices.Test.Shared/ProfileTest.ps1" ) ) ) ;
23
+ public static readonly ProfilePathInfo TestProfilePaths = new (
24
+ Path . GetFullPath ( TestUtilities . NormalizePath ( "../../../../PowerShellEditorServices.Test.Shared/Profile/Test.PowerShellEditorServices_profile.ps1" ) ) ,
25
+ Path . GetFullPath ( TestUtilities . NormalizePath ( "../../../../PowerShellEditorServices.Test.Shared/Profile/ProfileTest.ps1" ) ) ,
26
+ Path . GetFullPath ( TestUtilities . NormalizePath ( "../../../../PowerShellEditorServices.Test.Shared/Test.PowerShellEditorServices_profile.ps1" ) ) ,
27
+ Path . GetFullPath ( TestUtilities . NormalizePath ( "../../../../PowerShellEditorServices.Test.Shared/ProfileTest.ps1" ) ) ) ;
33
28
34
- public static readonly string BundledModulePath = Path . GetFullPath (
35
- TestUtilities . NormalizePath ( "../../../../../module" ) ) ;
36
-
37
- public static System . Management . Automation . Runspaces . Runspace InitialRunspace ;
29
+ public static readonly string BundledModulePath = Path . GetFullPath ( TestUtilities . NormalizePath ( "../../../../../module" ) ) ;
38
30
39
31
public static PsesInternalHost Create ( ILoggerFactory loggerFactory )
40
32
{
@@ -53,24 +45,23 @@ public static PsesInternalHost Create(ILoggerFactory loggerFactory)
53
45
}
54
46
55
47
HostStartupInfo testHostDetails = new (
56
- "PowerShell Editor Services Test Host" ,
57
- "Test.PowerShellEditorServices" ,
58
- new Version ( "1.0.0" ) ,
48
+ name : "PowerShell Editor Services Test Host" ,
49
+ profileId : "Test.PowerShellEditorServices" ,
50
+ version : new Version ( "1.0.0" ) ,
59
51
psHost : new NullPSHost ( ) ,
60
- TestProfilePaths ,
52
+ profilePaths : TestProfilePaths ,
61
53
featureFlags : Array . Empty < string > ( ) ,
62
54
additionalModules : Array . Empty < string > ( ) ,
63
- initialSessionState ,
55
+ initialSessionState : initialSessionState ,
64
56
logPath : null ,
65
- ( int ) LogLevel . None ,
57
+ logLevel : ( int ) LogLevel . None ,
66
58
consoleReplEnabled : false ,
67
59
usesLegacyReadLine : false ,
68
60
bundledModulePath : BundledModulePath ) ;
69
61
70
62
var psesHost = new PsesInternalHost ( loggerFactory , null , testHostDetails ) ;
71
63
72
64
// NOTE: Because this is used by constructors it can't use await.
73
- // TODO: Should we actually load profiles here?
74
65
if ( psesHost . TryStartAsync ( new HostStartOptions { LoadProfiles = true } , CancellationToken . None ) . GetAwaiter ( ) . GetResult ( ) )
75
66
{
76
67
return psesHost ;
0 commit comments