Remove Platform.SupportsRemoveDrive query

This commit is contained in:
Andrew Schwartzmeyer
2016-07-14 17:34:12 -07:00
parent dbe16ca5d7
commit a9484e45e9
2 changed files with 5 additions and 15 deletions
@@ -217,12 +217,6 @@ namespace System.Management.Automation
}
// non-windows does not support removing drives
internal static bool SupportsRemoveDrive()
{
return IsWindows;
}
// Platform methods prefixed NonWindows are:
// - non-windows by the definition of the IsWindows method above
// - here, because porting to Linux and other operating systems
@@ -607,15 +607,11 @@ namespace Microsoft.PowerShell.Commands
/// </returns>
protected override PSDriveInfo RemoveDrive(PSDriveInfo drive)
{
// if removing the drive is not supported, just return the drive
if (Platform.SupportsRemoveDrive())
{
return WinRemoveDrive(drive);
}
else
{
return drive;
}
#if LINUX
return drive;
#else
return WinRemoveDrive(drive);
#endif
}
private PSDriveInfo WinRemoveDrive(PSDriveInfo drive)