• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Using <drivename>: to set the location without special functions



I think this topic has been addressed multiple times in the newsgroup, but I
think the current implementation in not satisfactory. Therefore I think it
would be best to let everybody vote on this suggestion:

Problem: Most PowerShell beginners get confused because they can use the
DOS-style <drivename>: syntax to set-location to the specified drive in the
FileSystem, but they cannot (by default) use this syntax for other psDrives
like 'function:', 'env:' or 'myDrive:', because by default only the helper
functions 'A:' to 'Z:' are created.

I think it would reduce confusion of beginners if this syntax was supported
natively, because beginners wouldn't need to know about the small difference
between "C:" and "Env:" and the "magic functions" called "A:"..."Z:".

I know that it is possible to create these functions automatically at
PowerShell startup time by using the profile.ps1. But I think this is not a
good solution, because this doesn't work for drives that are created
interactively, except using a special script or function that does this
automatically. This makes the usage more complex and confusing than it
actually needs to be.

Furthermore, the output of "get-childitem function:" gets very untidy and
legthy if you add a function called <drivename>: for each and every psDrive
that you use.
At the moment I have 50 (!) helper functions (including A:...Z:) only for
this single purpose. This impairs the usabillity of the function drive in my
opinion because it makes is harder to find the information you are really
looking for.

Therefore I think the <drivename>: syntax should be integrated into
PowerShell itself without the need for special helper functions that fill up
the function drive.



My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)