To export to a .csv file with my script you can change the last line into:
} | Export-Csv -Path VMdatastoreInfo.csv -NoTypeInformation -UseCulture
To export to a .csv file with my script you can change the last line into:
} | Export-Csv -Path VMdatastoreInfo.csv -NoTypeInformation -UseCulture