mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Remove Platform.HasDriveAutoMounting query
This commit is contained in:
@@ -217,13 +217,6 @@ namespace System.Management.Automation
|
||||
|
||||
}
|
||||
|
||||
// This is mainly with respect to the auto-mounting of
|
||||
// disconnected network drives on Windows
|
||||
internal static bool HasDriveAutoMounting()
|
||||
{
|
||||
return IsWindows;
|
||||
}
|
||||
|
||||
// Linux does not have a registry
|
||||
internal static bool HasRegistrySupport()
|
||||
{
|
||||
|
||||
@@ -1469,11 +1469,12 @@ namespace System.Management.Automation
|
||||
bool driveIsValid = true;
|
||||
|
||||
// If the drive is auto-mounted, ensure that it still exists, or remove the drive.
|
||||
// note: not all platforms support drive auto-mounting
|
||||
if (Platform.HasDriveAutoMounting() && (drive.IsAutoMounted || IsAStaleVhdMountedDrive(drive)))
|
||||
#if !LINUX
|
||||
if (drive.IsAutoMounted || IsAStaleVhdMountedDrive(drive))
|
||||
{
|
||||
driveIsValid = ValidateOrRemoveAutoMountedDrive(drive, lookupScope);
|
||||
}
|
||||
#endif
|
||||
if(drive.Name.Length == 1)
|
||||
{
|
||||
if(!(driveNames.Contains(drive.Name)))
|
||||
|
||||
Reference in New Issue
Block a user