I have found several resources that use the following script to get folder sizes
$colItems = (Get-ChildItem $startFolder -recurse | Where-Object {$_.PSIsContaine
This simple solution worked for me as well.
powershell -c "Get-ChildItem -Recurse 'directory_path' | Measure-Object -Property Length -Sum"