-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Description
Using New-PSDrive -Persist, i.e. creating a persistent drive mapping at the OS level, is only supported on Windows.
While trying to use it on Unix-like platforms does report an error, the error message is confusing (see below).
Steps to reproduce
New-PSDrive -root '\\foo\bar\' -name N -PSProvider filesystem -PersistExpected behavior
The error message should indicate that the host platform is not supported, along the lines of System.PlatformNotSupportedException
Actual behavior
The following error is reported:
New-PSDrive : When you use the Persist parameter,
the root must be a file system location on a remote computer.
The reason is that the code currently blindly follows a Windows code path until it eventually hits the PathIsNetworkPath() method in FileSystemProvider.cs, which categorically returns false on Unix.
Environment data
PowerShell Core 6.2.0-preview.1 on macOS 10.14
PowerShell Core 6.2.0-preview.1 on Ubuntu 16.04.5 LTSMetadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.