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/39766db12a3df808eabe0aff44039676 to your computer and use it in GitHub Desktop.
Save Dan1el42/39766db12a3df808eabe0aff44039676 to your computer and use it in GitHub Desktop.
$filePath = "C:\Temp"
$selectPropertyList = @(
@{n='FileName';e={$_.Name.ToUpper()}}
@{n='Length (MB)';e= {[System.Decimal]::Round($_.Length/1MB, 2)}}
)
$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