Remove Platform.HasUNCSupport query

This commit is contained in:
Andrew Schwartzmeyer
2016-07-14 17:34:12 -07:00
parent 58fe228dc0
commit 2249afcd0a
3 changed files with 9 additions and 20 deletions
@@ -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)