Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$filePath = "C:\Temp"
$selectPropertyList = @(
@{n='FileName';e={$_.Name.ToUpper()}}
@{n='Length (MB)';e= {($_.Length/1MB).ToString('N2')}}
)
$files = Get-ChildItem -Path $filePath -File -Recurse -Force |
Select-Object -Property $selectPropertyList |
Sort-Object -Property 'Length (MB)' -Descending | Out-GridView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.