$Folders = Get-ChildItem "C:\Users\91977" -Directory | Select-Object -ExpandProperty FullName $Folders | ForEach-Object { $path = $_ if (Test-Path $path) { $size = (Get-ChildItem $path -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum [PSCustomObject]@{ Folder = $path Size_GB = [Math]::Round($size / 1GB, 2) } } else { [PSCustomObject]@{ Folder = $path Size_GB = "Path not found" } } }