If you don't move the Export-Csv outside of the loop, you will only have data for the last VM.
Try this version
$tgtDs=Get-Datastore-Name (Read-Host"Carefully enter the target Datastore name to move, PowerOFF and unregister the VM")$VMs=Get-Content-PathC:\Scripts\VM-To-sVMotion-Unregister.txt
$vmObj=Get-vm$vms
&{foreach($vmin$vmObj){ Move-VM-VM$vm-Datastore$tgtDs-Confirm:$false|Out-Null
Shutdown-VMGuest-VM$vm-Confirm:$false|Out-Null
Write-Host"Shutting down $vm"
# Set the amount of time to wait before assuming the remaining powered on guests are stuck do { # Wait for the VMs to be Shutdown cleanly sleep5
} until (Get-VM$vm|Where { $_.PowerState-eq"poweredOff" }) Write-Host"$vm Shutdown Complete"
Remove-VM-VM$vm-Confirm:$false-DeletePermanently:$false
Write-Host"Unregistering $vm"
$vm|SelectName,@{N="VMX";E={$vm.ExtensionData.Config.Files.VmPathName}} }} |Export-CsvC:\Scripts\vm-vmx.csv-NoTypeInformation-UseCulture