@@ -19,79 +19,6 @@ public static class PathExtensions
1919
2020 private const string _directorySeparator = "/" ;
2121
22- // [ThreadStatic]
23- // private static List<string>? s_normalizedPaths;
24-
25- // internal static string[] NormalizePath(
26- // this string[] paths,
27- // bool isLiteral,
28- // PSCmdlet cmdlet,
29- // bool throwOnInvalidProvider = false)
30- // {
31- // s_normalizedPaths ??= [];
32- // Collection<string> resolvedPaths;
33- // ProviderInfo provider;
34- // s_normalizedPaths.Clear();
35-
36- // foreach (string path in paths)
37- // {
38- // if (isLiteral)
39- // {
40- // string resolvedPath = cmdlet
41- // .SessionState.Path
42- // .GetUnresolvedProviderPathFromPSPath(path, out provider, out _);
43-
44- // if (!provider.IsFileSystem())
45- // {
46- // if (throwOnInvalidProvider)
47- // {
48- // cmdlet.ThrowTerminatingError(provider.ToInvalidProviderError(path));
49- // }
50-
51- // cmdlet.WriteError(provider.ToInvalidProviderError(path));
52- // continue;
53- // }
54-
55- // s_normalizedPaths.Add(resolvedPath);
56- // continue;
57- // }
58-
59- // try
60- // {
61- // resolvedPaths = cmdlet.GetResolvedProviderPathFromPSPath(path, out provider);
62-
63- // foreach (string resolvedPath in resolvedPaths)
64- // {
65- // if (!provider.IsFileSystem())
66- // {
67- // cmdlet.WriteError(provider.ToInvalidProviderError(resolvedPath));
68- // continue;
69- // }
70-
71- // s_normalizedPaths.Add(resolvedPath);
72- // }
73- // }
74- // catch (Exception exception)
75- // {
76-
77- // cmdlet.WriteError(exception.ToResolvePathError(path));
78- // }
79- // }
80-
81- // return [.. s_normalizedPaths];
82- // }
83-
84- // internal static string NormalizePath(
85- // this string path,
86- // bool isLiteral,
87- // PSCmdlet cmdlet,
88- // bool throwOnInvalidProvider = false) =>
89- // NormalizePath([path], isLiteral, cmdlet, throwOnInvalidProvider)
90- // .FirstOrDefault();
91-
92- // internal static bool IsFileSystem(this ProviderInfo provider) =>
93- // provider.ImplementingType == typeof(FileSystemProvider);
94-
9522 internal static string ResolvePath ( this string path , PSCmdlet cmdlet )
9623 {
9724 string resolved = cmdlet . SessionState . Path . GetUnresolvedProviderPathFromPSPath (
@@ -150,6 +77,6 @@ internal static bool IsDirectoryPath(this string path) =>
15077
15178 public static string NormalizePath ( this string path ) =>
15279 s_reEntryDir . IsMatch ( path )
153- ? NormalizeEntryPath ( path )
154- : NormalizeFileEntryPath ( path ) ;
80+ ? NormalizeEntryPath ( path )
81+ : NormalizeFileEntryPath ( path ) ;
15582}
0 commit comments