Snippets Collections
> powershell -command "Get-ChildItem -Path C:\ -Recurse | Sort-Object Length -Descending | Select-Object FullName, Length -First 20 | Format-Table -AutoSize";
Get-ChildItem -Path C:\ -Recurse -File -ErrorAction SilentlyContinue |
    Where-Object { $_.Length -gt 100MB } |
    Sort-Object Length -Descending |
    Select-Object @{Name='FullName'; Expression={$_.FullName}},
                  @{Name='Size'; Expression={
                      if ($_.Length -ge 1GB) {
                          [math]::Round($_.Length / 1GB, 2) + ' GB'
                      } elseif ($_.Length -ge 1MB) {
                          [math]::Round($_.Length / 1MB, 2) + ' MB'
                      } else {
                          [math]::Round($_.Length / 1KB, 2) + ' KB'
                      }
                  }} |
    Format-Table -AutoSize


FullName                                           Size 
--------                                           ----------
C:\some\path\to\largefile1.ext                      123.45 MB
C:\another\path\to\largefile2.ext                   110.98 MB
Get-ChildItem -Path C:\ -Recurse -File -ErrorAction SilentlyContinue |
    Where-Object { $_.Length -gt 100MB } |
    Sort-Object Length -Descending |
    Select-Object @{Name='FullName'; Expression={$_.FullName}},
                  @{Name='Size (MB)'; Expression={[math]::Round($_.Length / 1MB, 2)}} |
    Format-Table -AutoSize

FullName                                           Size (MB)
--------                                           ----------
C:\some\path\to\largefile1.ext                      123.45
C:\another\path\to\largefile2.ext                   110.98
Get-ChildItem -Path C:\ -Recurse -File -ErrorAction SilentlyContinue | Where-Object { $_.Length -gt 100MB } | Sort-Object Length -Descending | Select-Object FullName, Length | Format-Table -AutoSize

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension