$size = (Get-ChildItem -Path . -Recurse -File | Measure-Object -Property Length -Sum).Sum
Write-Output "Directory size: $([math]::Round($size / 1MB, 2)) MB"
If you want everything in one line:
$size = (Get-ChildItem -Path . -Recurse -File | Measure-Object -Property Length -Sum).Sum; Write-Output "Directory size: $([math]::Round($size / 1MB, 2)) MB"