This combines the .txt file and your original code.
The text file assumes 1 VM name per line.
Get-VM-Name (Get-Content-Path vmnames.txt)|
Select @{N=”Datacenter”;E={(Get-Datacenter-VM $_).Name}},
@{N="Cluster";E={(Get-Cluster-VM $_).Name}}, Name,
@{N="VMUUID";E={$_.ExtensionData.config.uuid}}|
Export-CSV"C:\DC-$(Get-Date-f ddMMyyyy).csv"-NoTypeInformation