I'm still new to PowerShell and trying to figure the best way to get the size of individual Itunes folders on our server. There are multiple folders and they are all located in the user profiles. This is the script i have so far but it doesnt show all the individual folders.
#Gets a list of all itunes folders
$dirOfItunes = dir -Recurse -Filter "iTunes Media" -ErrorAction silentlycontinue
Write-Host "list of itunes folders found: " $dirOfItunes
ForEach ($i in $dirOfItunes)
{
$UserItuneFolder = (Get-ChildItem -Recurse | Measure-Object -property length -sum)
Write-Host "details of Itunes folders found: " Write-Host $UserItuneFolder.get_Sum()
write-host "folder name: " $i.FullName
"size " + "{0:N2}" -f ($UserItuneFolder.sum / 1MB) + " MB"
}