4

In Powershell (at least in Windows 10EE), certain parts of the system are exposed under a custom drive label. The two main examples I know are:

  1. HKLM: exposes the local machine's registry as a drive.
  2. $Env: exposes the environment variables like their own filesystem.

However, cmd and batch scripts are not able to see these drives.

So my questions are:

  • How does Powershell implement these fake drive labels?
  • Are they similar to mountpoints in Linux?
  • Are they using some kind of pseudo-filesystem under the hood?
  • 2
    Read Get-Help New-PsDrive,Get-Help about_Providers or view online, about_Providers – LotPings Jun 20 at 15:17
  • It has nothing to do with Drive Letter (it is obviously more than a single letter, ain't it?). It is more like internet protocols. http://, ftp:// and remember Windows Help in CHM (compiled HTML) format? There is a special protocol too, mk-itsf:// or something like that. Some programs in Linux utilize the same concept too, example Gnome VFS. On the filesystem level, there are no any "drive labels" in UNIX, at all. But exposing non-files in files tree is the basic idea of UNIX from 1970-s. In Linux too. DevFS, ProcFS, SysFS, FUSE. Also google about Plan9 OS that thinks UNIX does not do enough – Arioch 'The Jun 20 at 16:25
  • What exactly is "Windows 10EE"? – Ramhound Jun 20 at 16:36
  • @Ramhound Windows 10, Enterprise Edition – Edward Minnix Jun 20 at 19:18
  • @EdwardMinnix - That is simply Windows 10 Enterprise. Referring to it as Windows 10 EE will confuse people. – Ramhound Jun 20 at 20:23
5

In PowerShell, those are called PSProviders

PowerShell providers are Microsoft .NET Framework-based programs that make the data in a specialized data store available in PowerShell so that you can view and manage it.

cmd / batch is not .NET Framework based, that's why they can't use them.

  • It has less to do with .net framework and more with Powershell itself. This is purely Powershell concept, so they are not available outside of Powersell at all. – Andrew Savinykh Jun 21 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.