I wanted to list disk drives in Windows (not with DISKPART) using PowerShell. I wanted the output to look something similar to the one you get on a Linux OS.
sudo fdisk -l gives and output like this.
*sudo is required as Linux won't let you run these commands under a normal user.
After trying to be funky with variables to get the output of the 'wmic logicaldisk GET VolumeName, Size, Caption to show up in Gigabytes I had given up until I realised Powershell has a built-in command let to just do something like that!
get-psdrive –psprovider filesystem
Sometimes it takes a failed attempt to get to a successful place!
sudo fdisk -l gives and output like this.
*sudo is required as Linux won't let you run these commands under a normal user.
After trying to be funky with variables to get the output of the 'wmic logicaldisk GET VolumeName, Size, Caption to show up in Gigabytes I had given up until I realised Powershell has a built-in command let to just do something like that!
get-psdrive –psprovider filesystem
Sometimes it takes a failed attempt to get to a successful place!
No comments:
Post a Comment