Export-VMSnapshot error

Welcome Forums General PowerShell Q&A Export-VMSnapshot error

This topic contains 4 replies, has 3 voices, and was last updated by

6 months, 3 weeks ago.

  • Author
  • #109742

    Points: 71
    Rank: Member

    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


    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.



  • #109766

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    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.

    • #109846

      Points: 71
      Rank: Member

      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?

  • #109996

    Points: 1,564
    Helping Hand
    Rank: Community Hero

    Are there any child snapshots ?

    • #110023

      Points: 71
      Rank: Member

      Thank you Prasoon!

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

The topic ‘Export-VMSnapshot error’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort