Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Is there a better way to expand a calculated field?

$
0
0

Not sure why you need the second select as

£> Get-Wmiobject -Class Win32_LogicalDisk |
Select @{n=’Drive’;e={$_.DeviceID.TrimEnd(‘:’)}}

Drive
—–
C
D
E
F

If you just want the drive letters then go with Dave’s suggestion or make it shorter liek this
(Get-Wmiobject -Class Win32_LogicalDisk).DeviceID.TrimEnd(‘:’)


Viewing all articles
Browse latest Browse all 13067