Get-ChildItem c: -r| sort -descending -property length | select -first 10 name, Length
Get-ChildItem : Access to the path 'C:WindowsCSC' is denied.
At line:1 char:1
+ Get-ChildItem c: -r| sort -descending -property length | select -fir ..
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:WindowsCSC:String) [Get-ChildItem], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem c: -r -ErrorAction SilentlyContinue –Force |sort -descending -property length | select -first 10 name, DirectoryName, @{Name='MB';Expression={[Math]::round($_.length / 1MB, 2)}}
Get-ChildItem c: -r|sort -descending -property length | select -first 10 name, DirectoryName, @{Name='MB';Expression={[Math]::round($_.length / 1MB, 2)}} | Out-GridView
$size=500*1024*1024
GCi C: -recurse -ErrorAction SilentlyContinue –Force | where-object {$_.length -gt $size} | Sort-Object length | ft fullname
GCi C: -recurse | where-object {$_.length -gt $size} | Sort-Object length | ft fullname | Export-Csv c:pcLargeFiles_Report.csv