C ve D diskinde dosyaların genel boyutlarını çıkartan powershell scripti.
$targetfolder='C:\'
$dataColl = @()
gci -force $targetfolder -ErrorAction SilentlyContinue | ? { $_ -is [io.directoryinfo] } | % {
$len = 0
gci -recurse -force $_.fullname -ErrorAction SilentlyContinue | % { $len += $_.length }
$filesCount = (gci -recurse -force $_.fullname -File -ErrorAction SilentlyContinue | Measure-Object).Count
$dataObject = New-Object PSObject -Property @{
Folder = $_.fullname
SizeGb = ('{0:N3}' -f ($len / 1Gb)) -as [single]
filesCount=$filesCount
}
$dataColl += $dataObject
}
$dataColl | Out-GridView -Title "Dosya boyutlari"
Program Çıktısı: