mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Remove Platform.HasUNCSupport query
This commit is contained in:
@@ -217,13 +217,6 @@ namespace System.Management.Automation
|
||||
|
||||
}
|
||||
|
||||
// Linux has no support for UNC, just mounts in a single rooted hierarchy
|
||||
// the UNC equivalent of a "network drive" aka mount would be the mount itself
|
||||
internal static bool HasUNCSupport()
|
||||
{
|
||||
return IsWindows;
|
||||
}
|
||||
|
||||
// Linux uses .net to query file attributes
|
||||
internal static bool UseDotNetToQueryFileAttributes()
|
||||
{
|
||||
|
||||
@@ -1129,12 +1129,12 @@ namespace System.Management.Automation
|
||||
|
||||
internal static bool PathIsUnc(string path)
|
||||
{
|
||||
if (!Platform.HasUNCSupport())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#if LINUX
|
||||
return false;
|
||||
#else
|
||||
Uri uri;
|
||||
return !string.IsNullOrEmpty(path) && Uri.TryCreate(path, UriKind.Absolute, out uri) && uri.IsUnc;
|
||||
#endif
|
||||
}
|
||||
|
||||
internal class NativeMethods
|
||||
|
||||
@@ -685,15 +685,11 @@ namespace Microsoft.PowerShell.Commands
|
||||
/// <returns></returns>
|
||||
internal static string GetUNCForNetworkDrive(string driveName)
|
||||
{
|
||||
// Porting note: on systems that do not support UNC paths, the UNC equivalent is the path itself
|
||||
if (Platform.HasUNCSupport())
|
||||
{
|
||||
return WinGetUNCForNetworkDrive(driveName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return driveName;
|
||||
}
|
||||
#if LINUX
|
||||
return driveName;
|
||||
#else
|
||||
return WinGetUNCForNetworkDrive(driveName);
|
||||
#endif
|
||||
}
|
||||
|
||||
private static string WinGetUNCForNetworkDrive(string driveName)
|
||||
|
||||
Reference in New Issue
Block a user