@@ -156,6 +156,8 @@ public void StartLogging(string logFilePath, LogLevel logLevel)
156
156
157
157
string buildTime = BuildInfo . BuildTime ? . ToString ( "s" , System . Globalization . CultureInfo . InvariantCulture ) ?? "<unspecified>" ;
158
158
159
+ string osArch = GetOSArchitecture ( ) ;
160
+
159
161
string logHeader = $@ "
160
162
PowerShell Editor Services Host v{ fileVersionInfo . FileVersion } starting (PID { Process . GetCurrentProcess ( ) . Id }
161
163
@@ -164,12 +166,12 @@ public void StartLogging(string logFilePath, LogLevel logLevel)
164
166
Name: { this . hostDetails . Name }
165
167
Version: { this . hostDetails . Version }
166
168
ProfileId: { this . hostDetails . ProfileId }
167
- Arch: { RuntimeInformation . OSArchitecture }
169
+ Arch: { osArch }
168
170
169
171
Operating system details:
170
172
171
173
Version: { osVersion }
172
- Arch: { RuntimeInformation . OSArchitecture }
174
+ Arch: { osArch }
173
175
174
176
Build information:
175
177
@@ -245,7 +247,7 @@ await this.editorSession.PowerShellContext.ImportCommandsModule(
245
247
// gets initialized when that is done earlier than LanguageServer.Initialize
246
248
foreach ( string module in this . additionalModules )
247
249
{
248
- var command =
250
+ var command =
249
251
new System . Management . Automation . PSCommand ( )
250
252
. AddCommand ( "Microsoft.PowerShell.Core\\ Import-Module" )
251
253
. AddParameter ( "Name" , module ) ;
@@ -493,6 +495,16 @@ private IServerListener CreateServiceListener(MessageProtocolType protocol, Edit
493
495
}
494
496
}
495
497
498
+ private static string GetOSArchitecture ( )
499
+ {
500
+ if ( IntPtr . Size == 8 )
501
+ {
502
+ return "X64" ;
503
+ }
504
+
505
+ return "X86" ;
506
+ }
507
+
496
508
#endregion
497
509
}
498
510
}
0 commit comments