Author Posts

August 23, 2018 at 1:40 pm

Hello Geeks,

I have a script which is failing when running the command;

Export-VMSnapshot -ComputerName $VM.HostName -VMName $VM.Name -Name "PostSysprep" -Path C:\Temp -ErrorAction Stop

Error;

Export-VMSnapshot : Failed to export virtual machine 'VMTemplate2016' because export directory named

'C:\Temp\Testexport\VMTemplate2016\Virtual Machines' already exists. (Virtual machine ID xxxx31E8-xxxx-4156-9465-xxxx2635Exxx)

Please help, I have tried using different folder, different VM, same error.

Thanks,

Kishor

August 23, 2018 at 3:06 pm

I'd not use C:\Temp, to begin with. It's complaining because it needs to create a bunch of subfolders, and the ones it needs to create already exist. It can't overwrite them. Try specifying the name of an empty folder.

August 24, 2018 at 11:43 am

Thanks for reply Don!

I have tried different options in this direction, creating new folder in 'Temp' and outside temp but I get same error, I don't understand when command is itself creating the folder why is it saying already exists?

August 25, 2018 at 5:23 pm

Are there any child snapshots ?

August 27, 2018 at 9:31 am

Thank you Prasoon!

Your hint solved my problem, while investigating I created lot of snapshots. After clearing them this command executed properly.