views:

475

answers:

3

Hi!

I have multiple volumes (as nearly everybody nowadays): on Windows they end up specified as C:, D: and so on. How do I list these all like on a Unix machine with "ls /mnt/" with Powershell?

+3  A: 

To get all of the file system drives, you can use the following command:

gdr | where {$_.Provider.Name -eq "FileSystem"}

gdr is an alias for Get-PSDrive, which includes all of the "virtual drives" for the registry, etc.

bdukes
damn you were faster than me :-)
streetparade
+3  A: 

Firstly, on Unix you use mount, not ls /mnt: many things are not mounted in /mnt.

Anyhow, there's the mountvol DOS command, which continues to work in Powershell, and there's the Powershell-specific Get-PSDrive.

ephemient
+1  A: 
streetparade
That's a nifty config for the prompt. Would you mind sharing the details of that?
wishi