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?
For a list of the Windows PowerShell drives in your Windows PowerShell session, use the Get-PSDrive cmdlet. Although the drives in the display vary with the drives on your system, the listing will look similar to the output of the Get-PSDrive command shown above.
You can do Invoke-Command -ComputerName hostname { Get-WmiObject Win32_PNPEntity | Select Name, DeviceID } to get a device list for a remote computer.
To get all of the file system drives, you can use the following command:
gdr -PSProvider 'FileSystem'
gdr
is an alias for Get-PSDrive
, which includes all of the "virtual drives" for the registry, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With