Skip to content

Commit a63c506

Browse files
daxian-dbwkilasuit
authored andcommitted
Some code cleanup work (PowerShell#10698)
* Move Utils.GetUserConfigurationDirectory to Platform.ConfigDirectory * Unify the use of Platform.ConfigDirectory and Platform.CacheDirectory
1 parent b755108 commit a63c506

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/System.Management.Automation/engine/PSConfiguration.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,11 @@ private PowerShellConfig()
8383
systemWideConfigFile = Path.Combine(systemWideConfigDirectory, ConfigFileName);
8484

8585
// Sets the per-user configuration directory
86-
// Note: This directory may or may not exist depending upon the execution scenario.
87-
// Writes will attempt to create the directory if it does not already exist.
86+
// Note: This directory may or may not exist depending upon the
87+
// execution scenario. Writes will attempt to create the directory
88+
// if it does not already exist.
8889
perUserConfigDirectory = Platform.ConfigDirectory;
89-
perUserConfigFile = Path.Combine(perUserConfigDirectory, ConfigFileName);
90-
91-
emptyConfig = new JObject();
92-
configRoots = new JObject[2];
93-
serializer = JsonSerializer.Create(new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.None, MaxDepth = 10 });
94-
95-
fileLock = new ReaderWriterLockSlim();
90+
perUserConfigFile = Path.Combine(perUserConfigDirectory, configFileName);
9691
}
9792

9893
private string GetConfigFilePath(ConfigScope scope)

0 commit comments

Comments
 (0)