# Aligning columns in Out-GridView

**URL:** <https://forums.powershell.org/t/aligning-columns-in-out-gridview/465>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/aligning-columns-in-out-gridview/465 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/aligning-columns-in-out-gridview/465/1 "2011-12-31T18:30:00Z")

</div>

by FilippoNeri at 2013-01-08 03:19:40

> Hi Folks,  
> I’ve created a PowerShell script to display logical disk information on a local or remote computer.  
> Is it possible to right align a column in a grid?  
> I use PowerShell version 2.  
>   
> `param( [string]$m=$env:ComputerName )Write-Host ""Write-Host "Drive Information for $m"$LD=Get-WmiObject Win32_LogicalDisk -ComputerName $m -Filter "driveType=3"$Size=@{Label="Size"; Expression={"{0:N2} GB" -f ($.Size/1GB)}}$FreeSpace=@{Label="Free Space"; Expression={"{0:N2} GB" -f ($.FreeSpace/1GB)}}$FreePercent=@{Label="Free %"; Expression={ "{0:P2} " -f ($.FreeSpace/$.Size) } }$LD | Select-Object DeviceID, VolumeName,$Size, $FreeSpace, $FreePercent | Out-GridView -Title "Logical Drives on $m"`

by DonJ at 2013-01-08 08:30:17

> No.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 9:04pm UTC](https://forums.powershell.org/t/aligning-columns-in-out-gridview/465/2 "2024-05-16T21:04:27Z")

</div>


