Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dan1el42/5a809c0157202709769a5f8503357e97 to your computer and use it in GitHub Desktop.
Save Dan1el42/5a809c0157202709769a5f8503357e97 to your computer and use it in GitHub Desktop.
$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