Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public static bool IsStaSupported
#endif

// format files
internal static readonly List<string> FormatFileNames = new()
internal static readonly string[] FormatFileNames = new string[]
{
"Certificate.format.ps1xml",
"Diagnostics.format.ps1xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1434,9 +1434,6 @@ private static InitialSessionState CreateRestrictedForRemoteServer()
return iss;
}

// Porting note: moved to Platform so we have one list to maintain
private static readonly string[] s_PSCoreFormatFileNames = Platform.FormatFileNames.ToArray();

private static void IncludePowerShellCoreFormats(InitialSessionState iss)
{
string psHome = Utils.DefaultPowerShellAppBase;
Expand All @@ -1446,7 +1443,7 @@ private static void IncludePowerShellCoreFormats(InitialSessionState iss)
}

iss.Formats.Clear();
foreach (var coreFormat in s_PSCoreFormatFileNames)
foreach (var coreFormat in Platform.FormatFileNames)
{
iss.Formats.Add(new SessionStateFormatEntry(Path.Combine(psHome, coreFormat)));
}
Expand Down