I am trying to get all drive letters of a Windows system with Powershell, but I cannot figure it out. Any Ideas?
I have tried to use Get-Volume, but it has no parameter for -ByDriveType or -ByType or -Type or anything.
If you only want the optical drives (as mentioned in your title), use this:
Get-CimInstance Win32_LogicalDisk | ?{ $_.DriveType -eq 5} | select DeviceID
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