Try something like this
$MyScript=@"
Get-WmiObject -Class Win32_Volume -Filter "DriveLetter = 'D:'" |
Set-WmiInstance -Arguments @{DriveLetter="E:"; Label="Label"}
"@
$vm=Get-VM-NameMyVM
Invoke-VMScript-VM$vm-ScriptText$MyScript-ScriptTypePowerShell-GuestUser$user-GuestPassword$pswd