thank luc
I was able to get that drive letter changed to E.
Then I added the hard drive with
get-vm vm | new-harddisk -capacitygb 100 -thinprovisioned
then ran the invoke-vmscript with diskpart
invoke-vmscript -vm vm -scripttext "diskpart /s dp.txt" -guestuser administrator -guestpassword xxxxx
but got this error
ScriptOutput
-------------------------------------------------------------------------------
| Microsoft DiskPart version 6.1.7601
| Copyright (C) 1999-2008 Microsoft Corporation.
| On computer: vm
|
| DiskPart was unable to open or read the script file.
| Make sure the file you specified exists.
|
-------------------------------------------------------------------------------
the file exist in the same directory the invoke-vmscript was ran.
any ideas?
thanks