4 Replies Latest reply on Feb 16, 2018 6:45 AM by RvdNieuwendijk

    VM Snapshot with Power shell cli

    danscorpio Lurker

      Hello All

       

      I do not have much knowledge of Powershell but I'm trying to create a snapshot in vcloud.link-connect.com with below script but I'm getting an error as term "Connect-CIServer is not recognized.

      I would really appreciate if you could help me fix this issue. please find my script below.

       

      if ( !(Get-Module -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue) ) {

      "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"

      }

      $srv= connect-CIServer -Server vcloud.link-connect.com -user xx -Password xxx -Org xxx

      $vm10 = Get-CIvm "xxxx"-

      $vm10.ExtensionData.RemoveAllSnapshots()

       

      $vm10.ExtensionData.CreateSnapshot($null,$null,"$null","$null")

       

      Many Thanks

      Dan