mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add support for \\wsl$\ubuntu path (#10674)
This commit is contained in:
committed by
Aditya Patwardhan
parent
bce5b20d2d
commit
ef2d740c44
@@ -1246,8 +1246,19 @@ namespace System.Management.Automation
|
||||
#if UNIX
|
||||
return false;
|
||||
#else
|
||||
if (string.IsNullOrEmpty(path) || !path.StartsWith('\\'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// handle special cases like \\wsl$\ubuntu which isn't a UNC path, but we can say it is so the filesystemprovider can use it
|
||||
if (path.StartsWith(@"\\wsl$", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Uri uri;
|
||||
return !string.IsNullOrEmpty(path) && Uri.TryCreate(path, UriKind.Absolute, out uri) && uri.IsUnc;
|
||||
return Uri.TryCreate(path, UriKind.Absolute, out uri) && uri.IsUnc;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user