mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Remove Platform.SupportsRemoveDrive query
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user