Make DirectoryName a calculated property:
Get-ChildItem -path D:\VmWare -Recurse |
Select @{ N = 'DirectoryName' ; E = {
If ( ! ( $_.PSIsContainer ))
{ $_.DirectoryName }
Else
{ Split-Path $_.FullName }
}}, Name, Extension, Length |
Export-Csv -Path D:\Temp\Test.csv -Encoding Unicode -NoTypeInformation